結果
問題 | No.2694 The Early Bird Catches The Worm |
ユーザー |
![]() |
提出日時 | 2024-03-22 21:35:34 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 169 ms / 2,000 ms |
コード長 | 397 bytes |
コンパイル時間 | 415 ms |
コンパイル使用メモリ | 82,020 KB |
実行使用メモリ | 131,844 KB |
最終ジャッジ日時 | 2024-09-30 11:02:09 |
合計ジャッジ時間 | 10,889 ms |
ジャッジサーバーID (参考情報) |
judge3 / 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()))ans=0R=0cumA=0cumB=0resB=0for L in range(N):while R!=N:ncumA=cumA+A[R]ncumB=cumB+B[R]*(R-L+1)nresB=resB+B[R]if ncumB<=H:R+=1cumA=ncumAcumB=ncumBresB=nresBelse:breakans=max(ans,cumA)cumA-=A[L]cumB-=resBresB-=B[L]print(ans)