結果

問題 No.1441 MErGe
ユーザー da_abda_ab
提出日時 2021-03-27 09:26:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 307 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 18,048 KB
最終ジャッジ日時 2024-05-06 21:49:30
合計ジャッジ時間 6,134 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
16,128 KB
testcase_01 AC 25 ms
10,496 KB
testcase_02 AC 26 ms
10,496 KB
testcase_03 AC 34 ms
11,264 KB
testcase_04 AC 39 ms
11,264 KB
testcase_05 AC 101 ms
11,392 KB
testcase_06 AC 105 ms
11,520 KB
testcase_07 AC 115 ms
11,392 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
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 #

# 1441 : MErGe

from sys import stdin

N,Q=list(map(int,stdin.readline().split()))
A=list(map(int,stdin.readline().split()))
for _ in range(Q):
    T,l,r=list(map(int,stdin.readline().split()))
    l-=1
    r-=1
    if T==1:
        A=A[0:l]+[sum(A[l:r+1])]+A[r+1:]
    else:
        print(sum(A[l:r+1]))


0