結果

問題 No.3065 Speedrun (Normal)
ユーザー ra5anchor
提出日時 2025-03-21 23:14:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 36 ms / 2,000 ms
コード長 304 bytes
コンパイル時間 307 ms
コンパイル使用メモリ 82,260 KB
実行使用メモリ 53,920 KB
最終ジャッジ日時 2025-03-21 23:14:19
合計ジャッジ時間 1,446 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

A = list(map(int, input().split()))
B = list(map(int, input().split()))
T = B[4]
B = B[:4]
AB = list(zip(A, B))
AB.sort(key=lambda x: -x[1])
# print(AB)
remain = T
cnt = 0
while remain > 0 and len(AB) > 0:
    a, b = AB.pop()
    num = min(a, remain // b)
    cnt += num
    remain -= num * b
print(cnt)
0