結果

問題 No.2694 The Early Bird Catches The Worm
ユーザー ntudantuda
提出日時 2024-03-23 12:38:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 431 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 137,576 KB
最終ジャッジ日時 2024-03-23 12:38:51
合計ジャッジ時間 13,482 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 WA -
testcase_03 AC 36 ms
53,460 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 36 ms
53,456 KB
testcase_06 AC 40 ms
59,444 KB
testcase_07 AC 37 ms
53,460 KB
testcase_08 AC 41 ms
59,448 KB
testcase_09 AC 37 ms
53,460 KB
testcase_10 AC 37 ms
53,460 KB
testcase_11 AC 37 ms
53,460 KB
testcase_12 AC 36 ms
53,460 KB
testcase_13 WA -
testcase_14 AC 38 ms
53,460 KB
testcase_15 AC 37 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 45 ms
53,460 KB
testcase_20 AC 38 ms
53,460 KB
testcase_21 AC 37 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,180 KB
testcase_25 AC 77 ms
89,048 KB
testcase_26 AC 82 ms
94,040 KB
testcase_27 AC 93 ms
98,656 KB
testcase_28 AC 93 ms
98,000 KB
testcase_29 AC 63 ms
79,300 KB
testcase_30 AC 120 ms
107,560 KB
testcase_31 AC 93 ms
98,760 KB
testcase_32 AC 150 ms
108,208 KB
testcase_33 AC 120 ms
108,180 KB
testcase_34 AC 49 ms
66,340 KB
testcase_35 AC 90 ms
99,808 KB
testcase_36 AC 97 ms
98,676 KB
testcase_37 AC 135 ms
112,880 KB
testcase_38 AC 105 ms
97,932 KB
testcase_39 AC 62 ms
77,992 KB
testcase_40 AC 94 ms
98,724 KB
testcase_41 AC 64 ms
82,488 KB
testcase_42 AC 46 ms
62,204 KB
testcase_43 AC 54 ms
70,472 KB
testcase_44 AC 159 ms
112,108 KB
testcase_45 AC 130 ms
112,112 KB
testcase_46 AC 71 ms
88,792 KB
testcase_47 AC 78 ms
91,552 KB
testcase_48 AC 97 ms
98,004 KB
testcase_49 AC 130 ms
113,564 KB
testcase_50 AC 130 ms
113,564 KB
testcase_51 AC 131 ms
113,564 KB
testcase_52 AC 130 ms
113,564 KB
testcase_53 AC 158 ms
113,584 KB
testcase_54 AC 152 ms
137,320 KB
testcase_55 AC 159 ms
137,576 KB
testcase_56 AC 150 ms
137,576 KB
testcase_57 AC 149 ms
137,448 KB
testcase_58 AC 147 ms
137,324 KB
testcase_59 AC 148 ms
137,324 KB
testcase_60 AC 151 ms
137,576 KB
testcase_61 AC 170 ms
137,452 KB
testcase_62 AC 151 ms
137,448 KB
testcase_63 AC 153 ms
137,448 KB
testcase_64 AC 150 ms
137,448 KB
testcase_65 AC 149 ms
137,452 KB
testcase_66 AC 151 ms
137,448 KB
testcase_67 AC 147 ms
137,320 KB
testcase_68 AC 164 ms
137,448 KB
testcase_69 AC 140 ms
132,844 KB
testcase_70 AC 140 ms
132,844 KB
testcase_71 AC 140 ms
132,840 KB
testcase_72 AC 141 ms
132,968 KB
testcase_73 AC 141 ms
132,848 KB
testcase_74 AC 93 ms
105,848 KB
testcase_75 AC 141 ms
132,840 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])
        j += 1
        tmp += B[j-1] * (j - i)
    tmp -= (B2[j] - B2[i])

print(ans)
0