結果

問題 No.2099 [Cherry Alpha B] Time Machine
ユーザー kept1994kept1994
提出日時 2022-11-03 21:20:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 500 ms / 2,000 ms
コード長 414 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 76,480 KB
最終ジャッジ日時 2023-09-25 04:48:59
合計ジャッジ時間 30,731 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 370 ms
75,668 KB
testcase_01 AC 371 ms
75,520 KB
testcase_02 AC 367 ms
75,588 KB
testcase_03 AC 370 ms
75,632 KB
testcase_04 AC 98 ms
75,328 KB
testcase_05 AC 371 ms
75,568 KB
testcase_06 AC 372 ms
75,564 KB
testcase_07 AC 371 ms
75,464 KB
testcase_08 AC 366 ms
75,556 KB
testcase_09 AC 372 ms
75,672 KB
testcase_10 AC 370 ms
75,680 KB
testcase_11 AC 373 ms
75,568 KB
testcase_12 AC 372 ms
75,684 KB
testcase_13 AC 374 ms
75,544 KB
testcase_14 AC 103 ms
75,304 KB
testcase_15 AC 372 ms
75,736 KB
testcase_16 AC 372 ms
75,528 KB
testcase_17 AC 370 ms
75,384 KB
testcase_18 AC 485 ms
76,228 KB
testcase_19 AC 487 ms
76,108 KB
testcase_20 AC 493 ms
76,196 KB
testcase_21 AC 498 ms
76,192 KB
testcase_22 AC 368 ms
75,464 KB
testcase_23 AC 370 ms
75,596 KB
testcase_24 AC 483 ms
76,176 KB
testcase_25 AC 500 ms
76,036 KB
testcase_26 AC 497 ms
76,208 KB
testcase_27 AC 371 ms
75,808 KB
testcase_28 AC 368 ms
75,564 KB
testcase_29 AC 99 ms
75,320 KB
testcase_30 AC 371 ms
75,704 KB
testcase_31 AC 368 ms
75,476 KB
testcase_32 AC 369 ms
75,632 KB
testcase_33 AC 371 ms
75,428 KB
testcase_34 AC 96 ms
75,108 KB
testcase_35 AC 371 ms
75,724 KB
testcase_36 AC 373 ms
75,676 KB
testcase_37 AC 366 ms
75,632 KB
testcase_38 AC 497 ms
76,208 KB
testcase_39 AC 496 ms
75,904 KB
testcase_40 AC 498 ms
75,908 KB
testcase_41 AC 367 ms
75,704 KB
testcase_42 AC 495 ms
76,320 KB
testcase_43 AC 369 ms
75,728 KB
testcase_44 AC 499 ms
76,480 KB
testcase_45 AC 493 ms
76,192 KB
testcase_46 AC 367 ms
75,564 KB
testcase_47 AC 495 ms
76,208 KB
testcase_48 AC 370 ms
75,528 KB
testcase_49 AC 102 ms
75,328 KB
testcase_50 AC 371 ms
75,460 KB
testcase_51 AC 368 ms
75,644 KB
testcase_52 AC 371 ms
76,008 KB
testcase_53 AC 99 ms
75,244 KB
testcase_54 AC 299 ms
76,116 KB
testcase_55 AC 489 ms
75,956 KB
testcase_56 AC 372 ms
75,552 KB
testcase_57 AC 370 ms
75,632 KB
testcase_58 AC 368 ms
75,632 KB
testcase_59 AC 372 ms
75,636 KB
testcase_60 AC 372 ms
75,704 KB
testcase_61 AC 371 ms
75,756 KB
testcase_62 AC 371 ms
75,564 KB
testcase_63 AC 371 ms
75,568 KB
testcase_64 AC 371 ms
75,548 KB
testcase_65 AC 458 ms
76,272 KB
testcase_66 AC 374 ms
75,516 KB
testcase_67 AC 470 ms
76,076 KB
testcase_68 AC 373 ms
75,564 KB
testcase_69 AC 373 ms
75,476 KB
testcase_70 AC 369 ms
75,672 KB
testcase_71 AC 494 ms
76,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
def main():
    T = int(input())
    X, A = map(int, input().split())
    Y, B = map(int, input().split())
    # p * X + q + r * Y
    ans = 10 ** 15
    for r in range(10 ** 7 + 1):
        dist = T + r * B
        if dist < 0:
            continue
        p, q = dist // A, dist % A
        ans = min(ans, p * X + q + r * Y)
    print(ans)
    return

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