結果

問題 No.1441 MErGe
ユーザー 👑 H20H20
提出日時 2021-03-26 22:10:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 292 bytes
コンパイル時間 1,182 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 253,104 KB
最終ジャッジ日時 2024-05-06 15:45:36
合計ジャッジ時間 8,913 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
61,012 KB
testcase_01 AC 36 ms
51,712 KB
testcase_02 AC 36 ms
52,224 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
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]+[sum(SA[l:r+1])]+SA[r+1:]
    if t==2:
        print(SA[r]-SA[l-1])
0