結果
| 問題 | No.1441 MErGe |
| コンテスト | |
| ユーザー |
H20
|
| 提出日時 | 2021-03-26 22:19:52 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 283 bytes |
| 記録 | |
| コンパイル時間 | 343 ms |
| コンパイル使用メモリ | 84,864 KB |
| 実行使用メモリ | 332,276 KB |
| 最終ジャッジ日時 | 2026-05-22 21:42:36 |
| 合計ジャッジ時間 | 6,965 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 11 TLE * 1 -- * 16 |
ソースコード
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]+[SA[r]]+SA[r+1:]
if t==2:
print(SA[r]-SA[l-1])
H20