結果

問題 No.1441 MErGe
ユーザー 👑 H20H20
提出日時 2021-03-26 22:19:52
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 283 bytes
コンパイル時間 424 ms
コンパイル使用メモリ 82,276 KB
実行使用メモリ 279,440 KB
最終ジャッジ日時 2024-05-06 15:59:20
合計ジャッジ時間 8,823 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
58,112 KB
testcase_01 AC 38 ms
52,224 KB
testcase_02 AC 39 ms
51,940 KB
testcase_03 AC 57 ms
69,120 KB
testcase_04 AC 67 ms
75,648 KB
testcase_05 AC 114 ms
77,312 KB
testcase_06 AC 118 ms
77,056 KB
testcase_07 AC 117 ms
76,928 KB
testcase_08 AC 449 ms
200,664 KB
testcase_09 AC 428 ms
198,460 KB
testcase_10 TLE -
testcase_11 TLE -
testcase_12 TLE -
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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])
0