結果

問題 No.865 24時間降水量
ユーザー kohei2019kohei2019
提出日時 2022-05-04 14:00:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 426 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 105,468 KB
最終ジャッジ日時 2023-09-16 16:36:44
合計ジャッジ時間 9,900 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
75,172 KB
testcase_01 AC 77 ms
75,228 KB
testcase_02 AC 71 ms
75,104 KB
testcase_03 AC 71 ms
75,212 KB
testcase_04 AC 69 ms
74,980 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 67 ms
71,296 KB
testcase_19 AC 72 ms
75,256 KB
testcase_20 AC 69 ms
75,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
lsA = list(map(int,input().split()))
Q = int(input())
lsTV = []
for i in range(Q):
    t,v = map(int,input().split())
    lsTV.append((t-1,v))
maxp = 0
for i in range(N-23):
    maxp = max(maxp,sum(lsA[i:i+24]))

for i in range(Q):
    t,v = lsTV[i]
    l,r = (max(0,i-24),i+24)
    lsA[t] = v
    for j in range(l,r):
        sm = sum(lsA[j:j+24])
        if maxp < sm:
            maxp = sm
    print(maxp)
0