結果

問題 No.1139 Slime Race
ユーザー ryusuke
提出日時 2022-01-31 23:58:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 147 ms / 2,000 ms
コード長 302 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 103,232 KB
最終ジャッジ日時 2024-06-11 09:06:16
合計ジャッジ時間 3,800 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

n, d = map(int, input().split())
x = list(map(int, input().split()))
v = list(map(int, input().split()))

l, r = 0, 10 ** 9 + 1
while r - l > 1:
    mid = (r + l) // 2
    cnt = 0
    for i in range(n):
        cnt += v[i] * mid
    
    if cnt >= d:
        r = mid
    else:
        l = mid

print(r)
0