結果

問題 No.1000 Point Add and Array Add
ユーザー brthyyjpbrthyyjp
提出日時 2020-02-28 22:42:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 383 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 57,072 KB
最終ジャッジ日時 2024-04-21 19:52:39
合計ジャッジ時間 14,848 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 522 ms
49,964 KB
testcase_01 AC 526 ms
44,208 KB
testcase_02 AC 527 ms
44,208 KB
testcase_03 AC 533 ms
44,072 KB
testcase_04 AC 527 ms
44,336 KB
testcase_05 AC 525 ms
44,228 KB
testcase_06 AC 523 ms
43,560 KB
testcase_07 AC 526 ms
43,796 KB
testcase_08 AC 527 ms
44,204 KB
testcase_09 AC 525 ms
43,828 KB
testcase_10 AC 525 ms
43,700 KB
testcase_11 AC 525 ms
43,956 KB
testcase_12 AC 534 ms
44,252 KB
testcase_13 AC 535 ms
43,452 KB
testcase_14 AC 547 ms
44,160 KB
testcase_15 AC 536 ms
44,180 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, q = map(int, input().split())
A = list(map(int, input().split()))

import numpy as np
A = np.array(A)
B = np.zeros(n, dtype = 'int64')

for _ in range(q):
    c, x, y = map(str, input().split())
    x = int(x)
    y = int(y)
    if c == 'A':
        x -= 1
        A[x] += y
    else:
        x, y = x-1, y-1
        B[x:y+1] += A[x:y+1]
#print(A)
#print(B)
B = list(B)
print(*B)
0