結果

問題 No.865 24時間降水量
ユーザー H3PO4H3PO4
提出日時 2021-03-01 09:08:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 413 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 29,920 KB
最終ジャッジ日時 2024-04-14 03:35:18
合計ジャッジ時間 6,325 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
17,572 KB
testcase_01 AC 34 ms
10,624 KB
testcase_02 AC 34 ms
10,624 KB
testcase_03 AC 32 ms
10,624 KB
testcase_04 AC 34 ms
10,752 KB
testcase_05 AC 50 ms
10,752 KB
testcase_06 AC 52 ms
10,624 KB
testcase_07 AC 51 ms
10,752 KB
testcase_08 AC 52 ms
10,752 KB
testcase_09 AC 52 ms
10,752 KB
testcase_10 AC 204 ms
10,880 KB
testcase_11 AC 202 ms
10,880 KB
testcase_12 AC 199 ms
10,880 KB
testcase_13 AC 188 ms
10,752 KB
testcase_14 AC 196 ms
10,880 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.buffer.readline

N = int(input())
A = list(map(int, input().split()))
table = [sum(A[i:i + 24]) for i in range(N - 23)]
Q = int(input())
ans = max(table)
for _ in range(Q):
    T, V = map(int, input().split())
    T -= 1
    diff = V - A[T]
    A[T] = V
    for i in range(max(0, T - 23), min(N - 24, T) + 1):
        table[i] += diff
        ans = max(ans, table[i])
    print(ans)
0