結果

問題 No.2694 The Early Bird Catches The Worm
ユーザー ntudantuda
提出日時 2024-03-23 12:41:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 165 ms / 2,000 ms
コード長 469 bytes
コンパイル時間 374 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 137,584 KB
最終ジャッジ日時 2024-03-23 12:41:28
合計ジャッジ時間 11,545 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 37 ms
53,460 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 36 ms
53,460 KB
testcase_06 AC 41 ms
59,444 KB
testcase_07 AC 37 ms
53,460 KB
testcase_08 AC 41 ms
59,448 KB
testcase_09 AC 38 ms
53,460 KB
testcase_10 AC 37 ms
53,460 KB
testcase_11 AC 37 ms
53,460 KB
testcase_12 AC 37 ms
53,460 KB
testcase_13 AC 37 ms
53,460 KB
testcase_14 AC 38 ms
53,460 KB
testcase_15 AC 39 ms
53,460 KB
testcase_16 AC 38 ms
53,460 KB
testcase_17 AC 38 ms
53,460 KB
testcase_18 AC 39 ms
53,460 KB
testcase_19 AC 37 ms
53,460 KB
testcase_20 AC 38 ms
53,460 KB
testcase_21 AC 36 ms
53,460 KB
testcase_22 AC 37 ms
53,460 KB
testcase_23 AC 37 ms
53,460 KB
testcase_24 AC 79 ms
91,308 KB
testcase_25 AC 77 ms
89,048 KB
testcase_26 AC 83 ms
94,040 KB
testcase_27 AC 94 ms
98,656 KB
testcase_28 AC 93 ms
97,992 KB
testcase_29 AC 64 ms
79,292 KB
testcase_30 AC 121 ms
107,552 KB
testcase_31 AC 92 ms
98,760 KB
testcase_32 AC 123 ms
108,208 KB
testcase_33 AC 122 ms
108,184 KB
testcase_34 AC 49 ms
66,340 KB
testcase_35 AC 90 ms
99,808 KB
testcase_36 AC 98 ms
98,672 KB
testcase_37 AC 136 ms
112,884 KB
testcase_38 AC 108 ms
97,936 KB
testcase_39 AC 61 ms
77,992 KB
testcase_40 AC 93 ms
98,724 KB
testcase_41 AC 64 ms
82,488 KB
testcase_42 AC 47 ms
64,312 KB
testcase_43 AC 54 ms
70,472 KB
testcase_44 AC 133 ms
112,108 KB
testcase_45 AC 133 ms
112,108 KB
testcase_46 AC 71 ms
88,792 KB
testcase_47 AC 79 ms
91,552 KB
testcase_48 AC 97 ms
97,996 KB
testcase_49 AC 144 ms
113,564 KB
testcase_50 AC 133 ms
113,564 KB
testcase_51 AC 133 ms
113,564 KB
testcase_52 AC 131 ms
113,564 KB
testcase_53 AC 133 ms
113,584 KB
testcase_54 AC 152 ms
137,452 KB
testcase_55 AC 152 ms
137,580 KB
testcase_56 AC 154 ms
137,580 KB
testcase_57 AC 151 ms
137,452 KB
testcase_58 AC 148 ms
137,332 KB
testcase_59 AC 151 ms
137,324 KB
testcase_60 AC 152 ms
137,584 KB
testcase_61 AC 151 ms
137,456 KB
testcase_62 AC 152 ms
137,452 KB
testcase_63 AC 156 ms
137,452 KB
testcase_64 AC 152 ms
137,456 KB
testcase_65 AC 152 ms
137,456 KB
testcase_66 AC 153 ms
137,452 KB
testcase_67 AC 149 ms
137,328 KB
testcase_68 AC 152 ms
137,452 KB
testcase_69 AC 143 ms
132,848 KB
testcase_70 AC 143 ms
132,848 KB
testcase_71 AC 165 ms
132,844 KB
testcase_72 AC 144 ms
132,972 KB
testcase_73 AC 141 ms
132,852 KB
testcase_74 AC 95 ms
105,848 KB
testcase_75 AC 141 ms
132,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,H = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
A2 = [0] + A[:]
B2 = [0] + B[:]
for i in range(1,N + 1):
    A2[i] += A2[i-1]
    B2[i] += B2[i-1]
j = 0
ans = 0
tmp = 0
for i in range(N):
    while j <= N and tmp <= H:
        ans = max(ans,A2[j] - A2[i])
        #print(i,j,tmp,A2[j] - A2[i])
        if j == N:
            break
        j += 1
        tmp += B[j-1] * (j - i)
    tmp -= (B2[j] - B2[i])

print(ans)
0