結果

問題 No.2694 The Early Bird Catches The Worm
ユーザー ypwwypww
提出日時 2024-02-15 22:44:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 531 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 48,132 KB
最終ジャッジ日時 2024-02-16 23:35:26
合計ジャッジ時間 24,790 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 30 ms
10,112 KB
testcase_02 AC 29 ms
10,112 KB
testcase_03 AC 29 ms
10,112 KB
testcase_04 AC 32 ms
10,112 KB
testcase_05 AC 29 ms
10,112 KB
testcase_06 AC 32 ms
10,240 KB
testcase_07 AC 30 ms
10,112 KB
testcase_08 AC 31 ms
10,240 KB
testcase_09 WA -
testcase_10 AC 30 ms
10,112 KB
testcase_11 AC 31 ms
10,112 KB
testcase_12 AC 29 ms
10,112 KB
testcase_13 AC 33 ms
10,112 KB
testcase_14 AC 31 ms
10,112 KB
testcase_15 AC 31 ms
10,112 KB
testcase_16 AC 31 ms
10,112 KB
testcase_17 AC 31 ms
10,112 KB
testcase_18 AC 31 ms
10,112 KB
testcase_19 AC 30 ms
10,112 KB
testcase_20 AC 30 ms
10,112 KB
testcase_21 AC 30 ms
10,112 KB
testcase_22 AC 30 ms
10,112 KB
testcase_23 AC 31 ms
10,112 KB
testcase_24 AC 169 ms
20,208 KB
testcase_25 AC 147 ms
19,096 KB
testcase_26 AC 191 ms
21,784 KB
testcase_27 AC 251 ms
26,272 KB
testcase_28 AC 299 ms
28,532 KB
testcase_29 AC 106 ms
16,052 KB
testcase_30 AC 460 ms
39,544 KB
testcase_31 AC 256 ms
26,624 KB
testcase_32 AC 468 ms
41,204 KB
testcase_33 AC 451 ms
40,136 KB
testcase_34 AC 49 ms
11,520 KB
testcase_35 AC 236 ms
25,688 KB
testcase_36 AC 321 ms
29,828 KB
testcase_37 AC 518 ms
43,984 KB
testcase_38 AC 339 ms
32,408 KB
testcase_39 AC 101 ms
15,160 KB
testcase_40 AC 246 ms
26,596 KB
testcase_41 AC 133 ms
17,612 KB
testcase_42 AC 37 ms
10,752 KB
testcase_43 AC 66 ms
12,672 KB
testcase_44 AC 498 ms
44,272 KB
testcase_45 AC 480 ms
44,264 KB
testcase_46 AC 163 ms
19,968 KB
testcase_47 AC 168 ms
20,712 KB
testcase_48 AC 287 ms
28,540 KB
testcase_49 AC 536 ms
29,468 KB
testcase_50 AC 533 ms
29,356 KB
testcase_51 AC 556 ms
29,352 KB
testcase_52 AC 543 ms
29,444 KB
testcase_53 AC 526 ms
29,444 KB
testcase_54 AC 578 ms
48,132 KB
testcase_55 AC 554 ms
48,132 KB
testcase_56 AC 547 ms
48,132 KB
testcase_57 AC 604 ms
48,132 KB
testcase_58 AC 546 ms
48,132 KB
testcase_59 AC 557 ms
48,132 KB
testcase_60 AC 579 ms
48,132 KB
testcase_61 AC 587 ms
48,132 KB
testcase_62 AC 618 ms
48,132 KB
testcase_63 AC 572 ms
48,132 KB
testcase_64 AC 550 ms
48,132 KB
testcase_65 AC 561 ms
48,132 KB
testcase_66 AC 548 ms
48,132 KB
testcase_67 AC 532 ms
48,132 KB
testcase_68 AC 528 ms
48,132 KB
testcase_69 AC 576 ms
39,552 KB
testcase_70 AC 549 ms
39,552 KB
testcase_71 AC 522 ms
39,552 KB
testcase_72 AC 543 ms
39,552 KB
testcase_73 AC 527 ms
39,552 KB
testcase_74 AC 271 ms
24,812 KB
testcase_75 AC 540 ms
39,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# WA 解法、不等号のミス
n,h = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

suma = [0]
for i in range(n):
    suma.append(suma[-1]+a[i])

sumb = [0]
for i in range(n):
    sumb.append(sumb[-1]+b[i])

now = 0
r = 0
ans = 0
for l in range(n):
    if l!=0:
        now -= sumb[r] - sumb[l-1]
    # 本来は <= の部分を < にした
    while r<n and now + (r-l+1)*b[r] < h:
        now += (r-l+1) * b[r]
        r += 1
    ans = max(ans, suma[r] - suma[l])

print(ans)
0