結果
問題 | No.865 24時間降水量 |
ユーザー |
👑 |
提出日時 | 2022-07-10 17:31:03 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 923 ms / 2,000 ms |
コード長 | 471 bytes |
コンパイル時間 | 477 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 104,320 KB |
最終ジャッジ日時 | 2024-06-11 06:57:31 |
合計ジャッジ時間 | 6,074 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
n = int(input())A = list(map(int, input().split()))ans = 0for i in range(23, n):tot = 0for j in range(i - 23, i + 1):tot += A[j]ans = max(ans, tot)Q = int(input())for _ in range(Q):t, v = map(int, input().split())t -= 1A[t] = vmi = max(0, t - 23)ma = min(t, n - 24)for i in range(mi, ma + 1):tot = 0for j in range(i, i + 24):tot += A[j]ans = max(ans, tot)print(ans)