結果

問題 No.1441 MErGe
ユーザー da_ab
提出日時 2021-03-27 09:26:27
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 307 bytes
コンパイル時間 249 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 45,196 KB
最終ジャッジ日時 2024-11-29 08:08:31
合計ジャッジ時間 47,332 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 6 TLE * 22
権限があれば一括ダウンロードができます

ソースコード

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