結果

問題 No.2099 [Cherry Alpha B] Time Machine
ユーザー rlangevinrlangevin
提出日時 2023-01-21 00:08:33
言語 PyPy3
(7.3.8)
結果
WA  
実行時間 -
コード長 355 bytes
コンパイル時間 281 ms
使用メモリ 75,840 KB
最終ジャッジ日時 2023-01-21 00:08:45
合計ジャッジ時間 9,722 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 77 ms
75,780 KB
testcase_01 AC 75 ms
75,300 KB
testcase_02 AC 76 ms
75,416 KB
testcase_03 AC 78 ms
75,624 KB
testcase_04 AC 77 ms
75,632 KB
testcase_05 AC 77 ms
75,288 KB
testcase_06 WA -
testcase_07 AC 76 ms
75,768 KB
testcase_08 AC 77 ms
75,520 KB
testcase_09 AC 77 ms
75,712 KB
testcase_10 AC 80 ms
75,516 KB
testcase_11 AC 83 ms
75,416 KB
testcase_12 AC 83 ms
75,372 KB
testcase_13 AC 76 ms
75,696 KB
testcase_14 AC 76 ms
75,300 KB
testcase_15 AC 77 ms
75,472 KB
testcase_16 WA -
testcase_17 AC 78 ms
75,628 KB
testcase_18 AC 76 ms
75,420 KB
testcase_19 AC 77 ms
75,416 KB
testcase_20 AC 78 ms
75,440 KB
testcase_21 AC 76 ms
75,596 KB
testcase_22 AC 79 ms
75,620 KB
testcase_23 AC 78 ms
75,536 KB
testcase_24 AC 78 ms
75,580 KB
testcase_25 AC 84 ms
75,380 KB
testcase_26 AC 85 ms
75,620 KB
testcase_27 AC 79 ms
75,460 KB
testcase_28 AC 77 ms
75,676 KB
testcase_29 AC 77 ms
75,780 KB
testcase_30 AC 77 ms
75,388 KB
testcase_31 WA -
testcase_32 AC 79 ms
75,736 KB
testcase_33 AC 78 ms
75,720 KB
testcase_34 AC 78 ms
75,596 KB
testcase_35 AC 76 ms
75,420 KB
testcase_36 WA -
testcase_37 AC 77 ms
75,392 KB
testcase_38 AC 77 ms
75,416 KB
testcase_39 AC 82 ms
75,788 KB
testcase_40 AC 84 ms
75,840 KB
testcase_41 AC 83 ms
75,352 KB
testcase_42 AC 76 ms
75,308 KB
testcase_43 AC 77 ms
75,664 KB
testcase_44 AC 78 ms
75,396 KB
testcase_45 AC 77 ms
75,804 KB
testcase_46 AC 77 ms
75,444 KB
testcase_47 AC 76 ms
75,392 KB
testcase_48 AC 77 ms
75,536 KB
testcase_49 AC 77 ms
75,392 KB
testcase_50 AC 77 ms
75,464 KB
testcase_51 WA -
testcase_52 AC 76 ms
75,736 KB
testcase_53 AC 77 ms
75,460 KB
testcase_54 AC 84 ms
75,300 KB
testcase_55 AC 85 ms
75,464 KB
testcase_56 AC 78 ms
75,484 KB
testcase_57 WA -
testcase_58 WA -
testcase_59 AC 78 ms
75,412 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