結果
問題 |
No.2694 The Early Bird Catches The Worm
|
ユーザー |
|
提出日時 | 2025-06-19 10:52:38 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 462 bytes |
コンパイル時間 | 513 ms |
コンパイル使用メモリ | 12,160 KB |
実行使用メモリ | 42,456 KB |
最終ジャッジ日時 | 2025-06-19 10:53:06 |
合計ジャッジ時間 | 27,011 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 17 WA * 55 |
ソースコード
n, h = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) ab = [0] * (n + 1) for i in range(n): ab[i + 1] = ab[i] + b[i] maxv, tired, sat, r = 0, 0, 0, 0 for l in range(n): while r < n and tired + (r - l + 1) * b[r] <= h: tired += (r - l + 1) * b[r] sat += a[r] r += 1 maxv = max(maxv, sat) if r > l: tired -= ab[r] - ab[l] sat -= a[l] print(maxv)