結果

問題 No.2099 [Cherry Alpha B] Time Machine
ユーザー rlangevinrlangevin
提出日時 2023-01-21 00:10:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 798 ms
コンパイル使用メモリ 86,484 KB
実行使用メモリ 71,124 KB
最終ジャッジ日時 2023-09-05 16:38:36
合計ジャッジ時間 7,755 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,016 KB
testcase_01 AC 68 ms
70,868 KB
testcase_02 AC 67 ms
70,608 KB
testcase_03 AC 68 ms
70,880 KB
testcase_04 AC 69 ms
71,012 KB
testcase_05 AC 69 ms
70,776 KB
testcase_06 AC 69 ms
70,800 KB
testcase_07 AC 69 ms
70,808 KB
testcase_08 AC 70 ms
71,004 KB
testcase_09 AC 71 ms
71,120 KB
testcase_10 AC 69 ms
70,940 KB
testcase_11 AC 67 ms
70,772 KB
testcase_12 AC 71 ms
70,808 KB
testcase_13 AC 69 ms
70,948 KB
testcase_14 AC 70 ms
71,100 KB
testcase_15 AC 70 ms
70,976 KB
testcase_16 AC 68 ms
71,100 KB
testcase_17 AC 69 ms
70,804 KB
testcase_18 AC 68 ms
70,612 KB
testcase_19 AC 68 ms
70,888 KB
testcase_20 AC 69 ms
70,872 KB
testcase_21 AC 69 ms
70,976 KB
testcase_22 AC 70 ms
70,616 KB
testcase_23 AC 68 ms
70,980 KB
testcase_24 AC 67 ms
70,808 KB
testcase_25 AC 69 ms
70,592 KB
testcase_26 AC 69 ms
70,616 KB
testcase_27 AC 67 ms
70,764 KB
testcase_28 AC 69 ms
70,952 KB
testcase_29 AC 69 ms
70,868 KB
testcase_30 AC 70 ms
70,876 KB
testcase_31 AC 68 ms
70,612 KB
testcase_32 AC 68 ms
70,888 KB
testcase_33 AC 67 ms
70,784 KB
testcase_34 AC 68 ms
70,948 KB
testcase_35 AC 68 ms
71,032 KB
testcase_36 AC 69 ms
70,588 KB
testcase_37 AC 73 ms
71,032 KB
testcase_38 AC 71 ms
70,952 KB
testcase_39 AC 69 ms
70,956 KB
testcase_40 AC 69 ms
71,096 KB
testcase_41 AC 69 ms
70,876 KB
testcase_42 AC 71 ms
71,096 KB
testcase_43 AC 69 ms
71,096 KB
testcase_44 AC 70 ms
70,952 KB
testcase_45 AC 69 ms
70,872 KB
testcase_46 AC 68 ms
70,872 KB
testcase_47 AC 69 ms
71,124 KB
testcase_48 AC 68 ms
70,880 KB
testcase_49 AC 69 ms
70,948 KB
testcase_50 AC 69 ms
70,756 KB
testcase_51 AC 68 ms
71,096 KB
testcase_52 AC 68 ms
70,820 KB
testcase_53 AC 69 ms
70,808 KB
testcase_54 AC 77 ms
70,948 KB
testcase_55 AC 71 ms
70,772 KB
testcase_56 AC 69 ms
70,888 KB
testcase_57 AC 67 ms
70,876 KB
testcase_58 AC 68 ms
70,896 KB
testcase_59 AC 68 ms
70,616 KB
testcase_60 WA -
testcase_61 AC 69 ms
70,772 KB
testcase_62 WA -
testcase_63 WA -
testcase_64 WA -
testcase_65 WA -
testcase_66 WA -
testcase_67 WA -
testcase_68 WA -
testcase_69 WA -
testcase_70 WA -
testcase_71 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(t):
    v = (t + B - 1)//B * Y
    t -= (t + B - 1)//B * B
    t = abs(t)
    v += t//A * X + t - t//A * A 
    return v

T = int(input())
X, A = map(int, input().split())
Y, B = map(int, input().split())
ans = 10 ** 18
if T >= 0:
    ans = T//A * X + T - T//A * A
    ans2 = (T + A - 1)//A * X
    T -= (T + A - 1)//A * A
    ans2 += f(-T)
    print(min(ans, ans2))
else:
    print(f(-T))
0