結果
| 問題 | No.2694 The Early Bird Catches The Worm |
| コンテスト | |
| ユーザー |
dp_ijk
|
| 提出日時 | 2024-03-23 05:09:19 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 466 bytes |
| コンパイル時間 | 368 ms |
| コンパイル使用メモリ | 82,596 KB |
| 実行使用メモリ | 131,104 KB |
| 最終ジャッジ日時 | 2024-09-30 13:03:53 |
| 合計ジャッジ時間 | 8,912 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 45 TLE * 1 -- * 26 |
ソースコード
from itertools import accumulate
N, H = map(int, input().split())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
A_wa = [0] + [*accumulate(A)]
B_wa = [0] + [*accumulate(B)]
r = 0
cost = 0
cands = []
for l in range(N+1):
if r > l:
r = l
cost = 0
while r < N and cost + (r-l+1) * B[r] <= H:
cost += (r-l+1) * B[r]
r += 1
cands.append(A_wa[r] - A_wa[l])
cost -= (B_wa[r] - B_wa[l])
print(max(cands))
dp_ijk