結果
問題 |
No.2694 The Early Bird Catches The Worm
|
ユーザー |
|
提出日時 | 2025-06-19 11:57:08 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 595 ms / 2,000 ms |
コード長 | 453 bytes |
コンパイル時間 | 454 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 40,736 KB |
最終ジャッジ日時 | 2025-06-19 11:57:37 |
合計ジャッジ時間 | 25,702 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 72 |
ソースコード
n, h = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) t = [0 for _ in range(n+1)] for i in range(n): t[i+1] = t[i] + b[i] maxv, sat, tired, 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) tired -= t[r] - t[l] sat -= a[l] print(maxv)