結果

問題 No.789 範囲の合計
ユーザー x2357x2357
提出日時 2019-02-17 11:57:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 265 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 11,876 KB
実行使用メモリ 29,532 KB
最終ジャッジ日時 2023-10-25 22:12:46
合計ジャッジ時間 5,818 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 27 ms
10,128 KB
testcase_02 RE -
testcase_03 AC 465 ms
24,752 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 423 ms
25,048 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
q = []
g = 0
for i in range(n):
    b = list(map(int ,input().split()))
    q.append(b)
    g = max(g,b[1],b[2])
a = [0]*g
ans = 0
for i in q:
    if i[0] == 0:
        a[i[1]] += i[2]
    if i[0] == 1:
        ans += sum(a[i[1]:i[2]+1])
print(ans)
0