結果
| 問題 | No.3684 chokudai_niku.png |
| コンテスト | |
| ユーザー |
redallen@競プロ
|
| 提出日時 | 2026-09-05 13:27:09 |
| 言語 | PyPy3 (7.3.23) |
| 結果 |
AC
|
| 実行時間 | 137 ms / 2,000 ms |
| + 116µs | |
| コード長 | 336 bytes |
| 記録 | |
| コンパイル時間 | 245 ms |
| コンパイル使用メモリ | 96,336 KB |
| 実行使用メモリ | 153,420 KB |
| 最終ジャッジ日時 | 2026-09-05 13:27:28 |
| 合計ジャッジ時間 | 11,256 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / 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()))
AB=[]
for _ in range(N):
if A[_]-B[_]>=0:
AB.append(A[_]-B[_])
else:
AB.append(0)
RAB=list(accumulate(AB))
MAX=RAB[M-1]
for i in range(M,N):
MAX=max(MAX,RAB[i]-RAB[i-M])
print(MAX)
redallen@競プロ