結果

問題 No.2099 [Cherry Alpha B] Time Machine
ユーザー kept1994kept1994
提出日時 2022-11-03 21:18:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 414 bytes
コンパイル時間 1,504 ms
コンパイル使用メモリ 87,232 KB
実行使用メモリ 76,380 KB
最終ジャッジ日時 2023-09-25 04:44:57
合計ジャッジ時間 30,941 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 382 ms
75,552 KB
testcase_01 AC 378 ms
75,580 KB
testcase_02 AC 370 ms
75,508 KB
testcase_03 AC 370 ms
75,464 KB
testcase_04 AC 98 ms
75,100 KB
testcase_05 AC 368 ms
75,584 KB
testcase_06 AC 369 ms
75,784 KB
testcase_07 AC 372 ms
75,548 KB
testcase_08 AC 371 ms
75,428 KB
testcase_09 AC 369 ms
75,552 KB
testcase_10 AC 370 ms
75,432 KB
testcase_11 AC 371 ms
75,572 KB
testcase_12 AC 369 ms
75,488 KB
testcase_13 AC 372 ms
75,556 KB
testcase_14 AC 101 ms
75,384 KB
testcase_15 AC 371 ms
75,792 KB
testcase_16 AC 368 ms
75,552 KB
testcase_17 AC 368 ms
75,616 KB
testcase_18 AC 486 ms
76,088 KB
testcase_19 AC 488 ms
75,892 KB
testcase_20 AC 487 ms
76,052 KB
testcase_21 AC 493 ms
75,896 KB
testcase_22 AC 367 ms
75,508 KB
testcase_23 AC 368 ms
75,564 KB
testcase_24 AC 477 ms
75,932 KB
testcase_25 AC 496 ms
75,896 KB
testcase_26 AC 493 ms
76,188 KB
testcase_27 AC 368 ms
75,568 KB
testcase_28 AC 367 ms
75,504 KB
testcase_29 AC 98 ms
75,332 KB
testcase_30 AC 367 ms
75,704 KB
testcase_31 AC 369 ms
75,472 KB
testcase_32 AC 368 ms
75,684 KB
testcase_33 AC 369 ms
75,728 KB
testcase_34 AC 101 ms
75,216 KB
testcase_35 AC 368 ms
75,588 KB
testcase_36 AC 372 ms
75,508 KB
testcase_37 AC 367 ms
75,508 KB
testcase_38 AC 496 ms
76,040 KB
testcase_39 AC 495 ms
75,892 KB
testcase_40 AC 493 ms
76,164 KB
testcase_41 AC 370 ms
75,572 KB
testcase_42 AC 493 ms
76,188 KB
testcase_43 AC 368 ms
75,536 KB
testcase_44 AC 496 ms
76,196 KB
testcase_45 AC 496 ms
76,320 KB
testcase_46 AC 369 ms
75,492 KB
testcase_47 AC 496 ms
76,172 KB
testcase_48 AC 367 ms
75,512 KB
testcase_49 AC 100 ms
75,208 KB
testcase_50 AC 369 ms
75,576 KB
testcase_51 AC 370 ms
75,540 KB
testcase_52 AC 368 ms
75,508 KB
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 AC 370 ms
75,508 KB
testcase_57 AC 370 ms
75,508 KB
testcase_58 AC 371 ms
75,720 KB
testcase_59 AC 370 ms
75,700 KB
testcase_60 AC 369 ms
75,584 KB
testcase_61 AC 371 ms
75,688 KB
testcase_62 AC 366 ms
75,544 KB
testcase_63 AC 371 ms
75,684 KB
testcase_64 AC 370 ms
75,532 KB
testcase_65 AC 457 ms
75,976 KB
testcase_66 AC 368 ms
75,484 KB
testcase_67 AC 467 ms
76,364 KB
testcase_68 AC 370 ms
75,652 KB
testcase_69 AC 367 ms
75,832 KB
testcase_70 AC 365 ms
75,648 KB
testcase_71 AC 485 ms
76,104 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 ** 12
    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