結果

問題 No.865 24時間降水量
ユーザー suika_psuika_p
提出日時 2019-08-17 00:30:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 454 bytes
コンパイル時間 132 ms
コンパイル使用メモリ 11,916 KB
実行使用メモリ 14,412 KB
最終ジャッジ日時 2023-10-24 13:33:56
合計ジャッジ時間 5,502 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
14,412 KB
testcase_01 AC 28 ms
10,064 KB
testcase_02 AC 28 ms
10,064 KB
testcase_03 AC 28 ms
10,064 KB
testcase_04 AC 28 ms
10,064 KB
testcase_05 AC 44 ms
10,156 KB
testcase_06 AC 45 ms
10,156 KB
testcase_07 AC 44 ms
10,156 KB
testcase_08 AC 44 ms
10,156 KB
testcase_09 AC 43 ms
10,156 KB
testcase_10 AC 188 ms
10,144 KB
testcase_11 AC 189 ms
10,144 KB
testcase_12 AC 187 ms
10,144 KB
testcase_13 AC 190 ms
10,144 KB
testcase_14 AC 191 ms
10,144 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
Q = int(input())

s = [0] * (N+1)
for i in range(N):
    if i >= 24:
        s[i+1] = s[i] + A[i] - A[i-24]
    else:
        s[i+1] = s[i] + A[i]

res = max(s)

for q in range(Q):
    T, V = map(int, input().split())
    diff = V - A[T-1]
    A[T-1] = V
    for i in range(24):
        if T+i <= N:
            s[T+i] += diff
            if res <= s[T+i]:
                res = s[T+i]
    print(res)
0