結果

問題 No.2694 The Early Bird Catches The Worm
ユーザー tkykwtnbtkykwtnb
提出日時 2024-03-23 08:25:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 554 ms / 2,000 ms
コード長 398 bytes
コンパイル時間 314 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 49,424 KB
最終ジャッジ日時 2024-03-23 08:25:47
合計ジャッジ時間 24,271 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
9,856 KB
testcase_01 AC 30 ms
9,856 KB
testcase_02 AC 29 ms
9,856 KB
testcase_03 AC 29 ms
9,856 KB
testcase_04 AC 29 ms
9,856 KB
testcase_05 AC 29 ms
9,856 KB
testcase_06 AC 33 ms
9,984 KB
testcase_07 AC 29 ms
9,856 KB
testcase_08 AC 36 ms
9,984 KB
testcase_09 AC 30 ms
9,856 KB
testcase_10 AC 29 ms
9,856 KB
testcase_11 AC 30 ms
9,856 KB
testcase_12 AC 29 ms
9,856 KB
testcase_13 AC 30 ms
9,856 KB
testcase_14 AC 29 ms
9,856 KB
testcase_15 AC 30 ms
9,856 KB
testcase_16 AC 31 ms
9,856 KB
testcase_17 AC 30 ms
9,856 KB
testcase_18 AC 30 ms
9,856 KB
testcase_19 AC 29 ms
9,856 KB
testcase_20 AC 30 ms
9,856 KB
testcase_21 AC 30 ms
9,856 KB
testcase_22 AC 30 ms
9,856 KB
testcase_23 AC 30 ms
9,856 KB
testcase_24 AC 154 ms
19,912 KB
testcase_25 AC 142 ms
18,728 KB
testcase_26 AC 180 ms
21,424 KB
testcase_27 AC 234 ms
26,008 KB
testcase_28 AC 250 ms
28,252 KB
testcase_29 AC 99 ms
15,788 KB
testcase_30 AC 388 ms
40,528 KB
testcase_31 AC 251 ms
26,380 KB
testcase_32 AC 412 ms
42,180 KB
testcase_33 AC 407 ms
39,872 KB
testcase_34 AC 46 ms
11,264 KB
testcase_35 AC 219 ms
24,944 KB
testcase_36 AC 287 ms
29,440 KB
testcase_37 AC 442 ms
43,788 KB
testcase_38 AC 313 ms
32,112 KB
testcase_39 AC 90 ms
14,876 KB
testcase_40 AC 238 ms
26,364 KB
testcase_41 AC 119 ms
17,352 KB
testcase_42 AC 36 ms
10,496 KB
testcase_43 AC 60 ms
12,416 KB
testcase_44 AC 449 ms
43,960 KB
testcase_45 AC 450 ms
43,956 KB
testcase_46 AC 153 ms
19,660 KB
testcase_47 AC 154 ms
20,436 KB
testcase_48 AC 265 ms
28,260 KB
testcase_49 AC 445 ms
29,224 KB
testcase_50 AC 477 ms
29,240 KB
testcase_51 AC 447 ms
29,236 KB
testcase_52 AC 471 ms
29,200 KB
testcase_53 AC 447 ms
29,212 KB
testcase_54 AC 504 ms
47,868 KB
testcase_55 AC 546 ms
49,424 KB
testcase_56 AC 508 ms
47,868 KB
testcase_57 AC 532 ms
47,872 KB
testcase_58 AC 486 ms
47,868 KB
testcase_59 AC 549 ms
47,868 KB
testcase_60 AC 508 ms
47,872 KB
testcase_61 AC 514 ms
47,872 KB
testcase_62 AC 554 ms
47,868 KB
testcase_63 AC 501 ms
47,868 KB
testcase_64 AC 516 ms
47,872 KB
testcase_65 AC 505 ms
47,872 KB
testcase_66 AC 552 ms
47,872 KB
testcase_67 AC 494 ms
47,868 KB
testcase_68 AC 483 ms
47,872 KB
testcase_69 AC 471 ms
38,408 KB
testcase_70 AC 456 ms
38,408 KB
testcase_71 AC 462 ms
38,408 KB
testcase_72 AC 451 ms
38,408 KB
testcase_73 AC 446 ms
38,408 KB
testcase_74 AC 226 ms
24,052 KB
testcase_75 AC 451 ms
38,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,H=map(int,input().split())
A=[0]+list(map(int,input().split()))
B=[0]+list(map(int,input().split()))
cumA=[0 for _ in range(N+1)]
cumB=[0 for _ in range(N+1)]
for i in range(1,N+1):
    cumA[i]=cumA[i-1]+A[i]
    cumB[i]=cumB[i-1]+B[i]
ans=0
l=1
s=0
for r in range(1,N+1):
    s+=(r-l+1)*B[r]
    while s>H:
        s-=cumB[r]-cumB[l-1]
        l+=1
    ans=max(ans,cumA[r]-cumA[l-1])
print(ans)
0