結果

問題 No.2099 [Cherry Alpha B] Time Machine
ユーザー aaaaaaaaaa2230
提出日時 2022-10-14 22:20:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 267 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 75,264 KB
最終ジャッジ日時 2024-06-26 15:28:44
合計ジャッジ時間 10,477 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 69 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

t = int(input())
x,a = map(int,input().split())
y,b = map(int,input().split())
ans = 10**10

for i in range(10**7+5):
    now = a*i
    dif = max(now-t,0)
    j = (dif+b-1)//b
    # print(i,now,dif,j,now-j*b)
    now -= j*b
    ans = min(ans,i*x+j*y+t-now)
print(ans)
0