結果
| 問題 | No.3684 chokudai_niku.png |
| コンテスト | |
| ユーザー |
yas_yasyu
|
| 提出日時 | 2026-09-05 13:18:07 |
| 言語 | PyPy3 (7.3.23) |
| 結果 |
AC
|
| 実行時間 | 137 ms / 2,000 ms |
| + 740µs | |
| コード長 | 307 bytes |
| 記録 | |
| コンパイル時間 | 229 ms |
| コンパイル使用メモリ | 95,956 KB |
| 実行使用メモリ | 140,040 KB |
| 最終ジャッジ日時 | 2026-09-05 13:18:20 |
| 合計ジャッジ時間 | 10,928 ms |
|
ジャッジサーバーID (参考情報) |
judge4_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 44 |
ソースコード
from itertools import accumulate
N, M = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
acc = list(accumulate(map(lambda x: max(x[0] - x[1], 0), zip(A, B)), initial=0))
ans = 0
for i in range(N - M + 1):
ans = max(ans, acc[i + M] - acc[i])
print(ans)
yas_yasyu