結果
| 問題 |
No.1441 MErGe
|
| コンテスト | |
| ユーザー |
H20
|
| 提出日時 | 2021-03-26 22:10:44 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 292 bytes |
| コンパイル時間 | 207 ms |
| コンパイル使用メモリ | 82,764 KB |
| 実行使用メモリ | 548,020 KB |
| 最終ジャッジ日時 | 2024-11-28 23:26:46 |
| 合計ジャッジ時間 | 35,627 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 1 WA * 10 TLE * 15 MLE * 2 |
ソースコード
import itertools
N,Q=map(int,input().split())
A = list(map(int,input().split()))
SA = list(itertools.accumulate(A))+[0]
for i in range(Q):
t,l,r=map(int,input().split())
l-=1
r-=1
if t==1:
SA = SA[:l]+[sum(SA[l:r+1])]+SA[r+1:]
if t==2:
print(SA[r]-SA[l-1])
H20