結果
問題 | No.865 24時間降水量 |
ユーザー |
|
提出日時 | 2021-03-01 09:08:02 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 413 bytes |
コンパイル時間 | 172 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 28,344 KB |
最終ジャッジ日時 | 2024-10-03 00:46:47 |
合計ジャッジ時間 | 5,692 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | AC * 15 TLE * 1 -- * 2 |
ソースコード
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)