結果

問題 No.2694 The Early Bird Catches The Worm
ユーザー sasa8uyauyasasa8uyauya
提出日時 2024-03-23 04:18:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 179 ms / 2,000 ms
コード長 272 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 131,368 KB
最終ジャッジ日時 2024-03-23 04:18:15
合計ジャッジ時間 11,007 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,332 KB
testcase_01 AC 37 ms
53,332 KB
testcase_02 AC 37 ms
53,332 KB
testcase_03 AC 38 ms
53,332 KB
testcase_04 AC 38 ms
53,332 KB
testcase_05 AC 38 ms
53,332 KB
testcase_06 AC 48 ms
59,444 KB
testcase_07 AC 56 ms
53,332 KB
testcase_08 AC 42 ms
59,460 KB
testcase_09 AC 39 ms
53,332 KB
testcase_10 AC 38 ms
53,332 KB
testcase_11 AC 37 ms
53,332 KB
testcase_12 AC 38 ms
53,332 KB
testcase_13 AC 37 ms
53,332 KB
testcase_14 AC 38 ms
53,332 KB
testcase_15 AC 38 ms
53,332 KB
testcase_16 AC 38 ms
53,332 KB
testcase_17 AC 38 ms
53,332 KB
testcase_18 AC 38 ms
53,332 KB
testcase_19 AC 37 ms
53,332 KB
testcase_20 AC 39 ms
53,332 KB
testcase_21 AC 37 ms
53,332 KB
testcase_22 AC 37 ms
53,332 KB
testcase_23 AC 39 ms
53,332 KB
testcase_24 AC 72 ms
87,596 KB
testcase_25 AC 80 ms
87,560 KB
testcase_26 AC 82 ms
92,120 KB
testcase_27 AC 96 ms
98,528 KB
testcase_28 AC 99 ms
97,880 KB
testcase_29 AC 68 ms
79,604 KB
testcase_30 AC 123 ms
102,572 KB
testcase_31 AC 100 ms
98,632 KB
testcase_32 AC 122 ms
102,840 KB
testcase_33 AC 127 ms
103,068 KB
testcase_34 AC 59 ms
68,312 KB
testcase_35 AC 96 ms
97,248 KB
testcase_36 AC 102 ms
98,684 KB
testcase_37 AC 133 ms
107,120 KB
testcase_38 AC 138 ms
97,772 KB
testcase_39 AC 66 ms
77,688 KB
testcase_40 AC 90 ms
98,596 KB
testcase_41 AC 69 ms
82,140 KB
testcase_42 AC 48 ms
64,188 KB
testcase_43 AC 52 ms
68,236 KB
testcase_44 AC 133 ms
106,360 KB
testcase_45 AC 132 ms
106,488 KB
testcase_46 AC 79 ms
89,472 KB
testcase_47 AC 83 ms
89,888 KB
testcase_48 AC 97 ms
97,880 KB
testcase_49 AC 140 ms
113,436 KB
testcase_50 AC 139 ms
113,436 KB
testcase_51 AC 136 ms
113,436 KB
testcase_52 AC 133 ms
113,436 KB
testcase_53 AC 146 ms
113,456 KB
testcase_54 AC 155 ms
131,240 KB
testcase_55 AC 154 ms
131,368 KB
testcase_56 AC 150 ms
131,236 KB
testcase_57 AC 164 ms
131,112 KB
testcase_58 AC 151 ms
131,116 KB
testcase_59 AC 152 ms
131,240 KB
testcase_60 AC 154 ms
131,364 KB
testcase_61 AC 154 ms
131,112 KB
testcase_62 AC 158 ms
131,236 KB
testcase_63 AC 147 ms
131,112 KB
testcase_64 AC 151 ms
131,112 KB
testcase_65 AC 179 ms
131,108 KB
testcase_66 AC 155 ms
131,240 KB
testcase_67 AC 151 ms
131,240 KB
testcase_68 AC 150 ms
131,176 KB
testcase_69 AC 134 ms
126,628 KB
testcase_70 AC 133 ms
126,628 KB
testcase_71 AC 134 ms
126,632 KB
testcase_72 AC 135 ms
126,632 KB
testcase_73 AC 136 ms
126,636 KB
testcase_74 AC 92 ms
102,520 KB
testcase_75 AC 137 ms
126,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,h=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
g=0
r=0
s1=0
s2=0
s3=0
for l in range(n):
	while r+1<=n and s2+(r+1-l)*b[r]<=h:
		s1+=a[r]
		s2+=(r+1-l)*b[r]
		s3+=b[r]
		r+=1
	g=max(g,s1)
	s1-=a[l]
	s2-=s3
	s3-=b[l]
print(g)
0