結果
| 問題 |
No.2694 The Early Bird Catches The Worm
|
| コンテスト | |
| ユーザー |
ニックネーム
|
| 提出日時 | 2024-03-22 21:58:08 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 726 ms / 2,000 ms |
| コード長 | 338 bytes |
| コンパイル時間 | 452 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 40,876 KB |
| 最終ジャッジ日時 | 2024-09-30 11:30:05 |
| 合計ジャッジ時間 | 28,723 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 72 |
ソースコード
n,h = map(int,input().split())
a = list(map(int,input().split()))+[0]
b = list(map(int,input().split()))+[0]
for i in range(n,0,-1): a[i-1] += a[i]; b[i-1] += b[i]
k = x = 0; l = r = n
while r>0:
while l>0 and k+b[l-1]-b[r]<=h: k += b[l-1]-b[r]; l -= 1
x = max(x,a[l]-a[r]); k -= (b[r-1]-b[r])*(r-l); r -= 1; l = min(l,r)
print(x)
ニックネーム