結果

問題 No.2099 [Cherry Alpha B] Time Machine
ユーザー flygonflygon
提出日時 2022-10-14 21:58:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 368 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 76,100 KB
最終ジャッジ日時 2023-09-08 21:10:16
合計ジャッジ時間 10,929 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,332 KB
testcase_01 AC 72 ms
71,224 KB
testcase_02 AC 78 ms
75,728 KB
testcase_03 AC 111 ms
75,784 KB
testcase_04 AC 102 ms
75,936 KB
testcase_05 AC 75 ms
71,396 KB
testcase_06 WA -
testcase_07 AC 122 ms
75,808 KB
testcase_08 AC 123 ms
75,924 KB
testcase_09 AC 122 ms
75,608 KB
testcase_10 AC 114 ms
75,888 KB
testcase_11 AC 85 ms
75,760 KB
testcase_12 AC 121 ms
75,888 KB
testcase_13 AC 112 ms
75,732 KB
testcase_14 AC 100 ms
75,932 KB
testcase_15 AC 71 ms
71,448 KB
testcase_16 WA -
testcase_17 AC 124 ms
75,980 KB
testcase_18 AC 72 ms
71,448 KB
testcase_19 AC 72 ms
71,204 KB
testcase_20 AC 71 ms
71,480 KB
testcase_21 AC 72 ms
71,252 KB
testcase_22 AC 128 ms
75,856 KB
testcase_23 AC 88 ms
75,788 KB
testcase_24 AC 72 ms
71,224 KB
testcase_25 AC 71 ms
71,204 KB
testcase_26 AC 72 ms
71,236 KB
testcase_27 AC 92 ms
75,800 KB
testcase_28 AC 111 ms
75,504 KB
testcase_29 AC 98 ms
75,912 KB
testcase_30 AC 72 ms
71,204 KB
testcase_31 WA -
testcase_32 AC 121 ms
75,768 KB
testcase_33 AC 111 ms
75,872 KB
testcase_34 AC 102 ms
75,852 KB
testcase_35 AC 73 ms
71,392 KB
testcase_36 WA -
testcase_37 AC 122 ms
75,504 KB
testcase_38 AC 74 ms
71,292 KB
testcase_39 AC 73 ms
71,228 KB
testcase_40 AC 73 ms
71,148 KB
testcase_41 AC 109 ms
75,760 KB
testcase_42 AC 75 ms
71,304 KB
testcase_43 AC 79 ms
75,760 KB
testcase_44 AC 73 ms
71,208 KB
testcase_45 AC 72 ms
71,164 KB
testcase_46 AC 105 ms
75,764 KB
testcase_47 AC 73 ms
71,100 KB
testcase_48 AC 110 ms
75,704 KB
testcase_49 AC 99 ms
75,572 KB
testcase_50 AC 73 ms
71,316 KB
testcase_51 WA -
testcase_52 AC 122 ms
75,792 KB
testcase_53 AC 101 ms
75,836 KB
testcase_54 AC 78 ms
75,632 KB
testcase_55 AC 72 ms
71,300 KB
testcase_56 AC 133 ms
75,752 KB
testcase_57 WA -
testcase_58 WA -
testcase_59 AC 133 ms
75,788 KB
testcase_60 WA -
testcase_61 AC 134 ms
75,608 KB
testcase_62 WA -
testcase_63 AC 132 ms
75,892 KB
testcase_64 WA -
testcase_65 AC 149 ms
75,924 KB
testcase_66 WA -
testcase_67 AC 156 ms
75,616 KB
testcase_68 WA -
testcase_69 AC 132 ms
75,960 KB
testcase_70 WA -
testcase_71 AC 164 ms
76,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t = int(input())
x,a = map(int,input().split())
y,b = map(int,input().split())
ans = float("inf")
if t >= 0:
  for i in range(t+1):
    back = b*i
    z = t+back
    ans = min(ans, y*i+(z//a)*x + z%a)
else:
  t *= -1
  for i in range(10**7):
    fwd = a*i
    if fwd > 10**7: break
    z = t + fwd
    ans = min(ans, y*((z+b-1)//b) + b*((z+b-1)//b)-z)
    

print(ans)
0