結果

問題 No.2099 [Cherry Alpha B] Time Machine
ユーザー kept1994kept1994
提出日時 2022-11-03 20:43:26
言語 PyPy3
(7.3.8)
結果
WA  
実行時間 -
コード長 576 bytes
コンパイル時間 276 ms
使用メモリ 75,952 KB
最終ジャッジ日時 2023-02-15 20:12:48
合計ジャッジ時間 10,896 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 83 ms
75,400 KB
testcase_01 AC 82 ms
75,684 KB
testcase_02 AC 82 ms
75,496 KB
testcase_03 AC 83 ms
75,720 KB
testcase_04 WA -
testcase_05 AC 83 ms
75,448 KB
testcase_06 AC 84 ms
75,720 KB
testcase_07 AC 84 ms
75,716 KB
testcase_08 AC 83 ms
75,748 KB
testcase_09 AC 82 ms
75,772 KB
testcase_10 AC 82 ms
75,436 KB
testcase_11 AC 81 ms
75,844 KB
testcase_12 AC 81 ms
75,776 KB
testcase_13 AC 82 ms
75,752 KB
testcase_14 WA -
testcase_15 AC 82 ms
75,660 KB
testcase_16 AC 82 ms
75,452 KB
testcase_17 AC 81 ms
75,444 KB
testcase_18 AC 82 ms
75,740 KB
testcase_19 AC 81 ms
75,828 KB
testcase_20 AC 81 ms
75,752 KB
testcase_21 AC 82 ms
75,500 KB
testcase_22 AC 81 ms
75,748 KB
testcase_23 AC 82 ms
75,744 KB
testcase_24 AC 82 ms
75,560 KB
testcase_25 AC 82 ms
75,508 KB
testcase_26 AC 82 ms
75,488 KB
testcase_27 AC 82 ms
75,404 KB
testcase_28 AC 83 ms
75,868 KB
testcase_29 WA -
testcase_30 AC 84 ms
75,728 KB
testcase_31 AC 82 ms
75,552 KB
testcase_32 AC 83 ms
75,720 KB
testcase_33 AC 83 ms
75,552 KB
testcase_34 WA -
testcase_35 AC 82 ms
75,440 KB
testcase_36 AC 82 ms
75,748 KB
testcase_37 AC 84 ms
75,744 KB
testcase_38 AC 82 ms
75,852 KB
testcase_39 AC 84 ms
75,720 KB
testcase_40 WA -
testcase_41 AC 82 ms
75,724 KB
testcase_42 AC 84 ms
75,708 KB
testcase_43 AC 83 ms
75,440 KB
testcase_44 AC 83 ms
75,744 KB
testcase_45 AC 83 ms
75,444 KB
testcase_46 AC 83 ms
75,496 KB
testcase_47 AC 83 ms
75,752 KB
testcase_48 AC 83 ms
75,440 KB
testcase_49 WA -
testcase_50 AC 83 ms
75,656 KB
testcase_51 AC 83 ms
75,560 KB
testcase_52 AC 83 ms
75,712 KB
testcase_53 WA -
testcase_54 AC 82 ms
75,720 KB
testcase_55 WA -
testcase_56 WA -
testcase_57 AC 83 ms
75,548 KB
testcase_58 AC 82 ms
75,732 KB
testcase_59 WA -
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 #

#!/usr/bin/env python3
def main():
    T = int(input())
    X, A = map(int, input().split())
    Y, B = map(int, input().split())
    if T > 0:
        p, q = divmod(T, A)
        path1 = p * X + q # A + walk
        back = A - q
        tt, ss = divmod(back, B)
        backagain = B - ss
        path2 = (p + 1) * X + (tt + 1) * Y + backagain # A + B + walk
        print(min(path1, path2))
    else:
        p, q = divmod(-T, B)
        back = B - q
        tt, ss = divmod(back, A)
        print((p + 1) * Y + tt * X + ss)
    return

if __name__ == '__main__':
    main()
0