結果

問題 No.2099 [Cherry Alpha B] Time Machine
ユーザー rlangevinrlangevin
提出日時 2023-01-21 00:08:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 355 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 71,608 KB
最終ジャッジ日時 2023-09-05 16:36:20
合計ジャッジ時間 10,342 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,112 KB
testcase_01 AC 78 ms
71,056 KB
testcase_02 AC 77 ms
70,904 KB
testcase_03 AC 80 ms
71,136 KB
testcase_04 AC 76 ms
71,084 KB
testcase_05 AC 77 ms
70,680 KB
testcase_06 WA -
testcase_07 AC 78 ms
71,088 KB
testcase_08 AC 79 ms
70,816 KB
testcase_09 AC 78 ms
71,000 KB
testcase_10 AC 77 ms
70,948 KB
testcase_11 AC 77 ms
70,848 KB
testcase_12 AC 79 ms
71,016 KB
testcase_13 AC 78 ms
70,824 KB
testcase_14 AC 77 ms
70,948 KB
testcase_15 AC 77 ms
70,820 KB
testcase_16 WA -
testcase_17 AC 80 ms
70,816 KB
testcase_18 AC 78 ms
70,820 KB
testcase_19 AC 77 ms
71,088 KB
testcase_20 AC 77 ms
70,820 KB
testcase_21 AC 78 ms
70,952 KB
testcase_22 AC 77 ms
70,824 KB
testcase_23 AC 77 ms
70,868 KB
testcase_24 AC 78 ms
71,080 KB
testcase_25 AC 77 ms
70,952 KB
testcase_26 AC 78 ms
70,820 KB
testcase_27 AC 77 ms
70,844 KB
testcase_28 AC 78 ms
70,948 KB
testcase_29 AC 77 ms
71,016 KB
testcase_30 AC 78 ms
70,924 KB
testcase_31 WA -
testcase_32 AC 77 ms
70,688 KB
testcase_33 AC 76 ms
71,140 KB
testcase_34 AC 78 ms
70,952 KB
testcase_35 AC 77 ms
70,976 KB
testcase_36 WA -
testcase_37 AC 78 ms
71,000 KB
testcase_38 AC 77 ms
70,840 KB
testcase_39 AC 77 ms
71,068 KB
testcase_40 AC 79 ms
71,108 KB
testcase_41 AC 78 ms
71,000 KB
testcase_42 AC 76 ms
71,036 KB
testcase_43 AC 78 ms
70,924 KB
testcase_44 AC 77 ms
71,032 KB
testcase_45 AC 76 ms
71,112 KB
testcase_46 AC 78 ms
71,140 KB
testcase_47 AC 78 ms
70,996 KB
testcase_48 AC 80 ms
70,944 KB
testcase_49 AC 79 ms
71,160 KB
testcase_50 AC 79 ms
70,948 KB
testcase_51 WA -
testcase_52 AC 79 ms
71,132 KB
testcase_53 AC 78 ms
70,864 KB
testcase_54 AC 78 ms
70,996 KB
testcase_55 AC 80 ms
70,680 KB
testcase_56 AC 78 ms
71,016 KB
testcase_57 WA -
testcase_58 WA -
testcase_59 AC 79 ms
71,068 KB
testcase_60 WA -
testcase_61 WA -
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
    return v + abs(t)

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