結果

問題 No.2099 [Cherry Alpha B] Time Machine
ユーザー kept1994kept1994
提出日時 2022-11-03 21:18:22
言語 PyPy3
(7.3.8)
結果
WA  
実行時間 -
コード長 414 bytes
コンパイル時間 270 ms
使用メモリ 80,916 KB
最終ジャッジ日時 2023-02-15 20:42:56
合計ジャッジ時間 30,298 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 363 ms
80,556 KB
testcase_01 AC 365 ms
80,440 KB
testcase_02 AC 371 ms
80,296 KB
testcase_03 AC 367 ms
80,368 KB
testcase_04 AC 104 ms
79,888 KB
testcase_05 AC 367 ms
80,372 KB
testcase_06 AC 369 ms
80,296 KB
testcase_07 AC 370 ms
80,528 KB
testcase_08 AC 366 ms
80,304 KB
testcase_09 AC 373 ms
80,300 KB
testcase_10 AC 367 ms
80,404 KB
testcase_11 AC 364 ms
80,220 KB
testcase_12 AC 366 ms
80,284 KB
testcase_13 AC 370 ms
80,416 KB
testcase_14 AC 102 ms
79,920 KB
testcase_15 AC 364 ms
80,208 KB
testcase_16 AC 370 ms
80,304 KB
testcase_17 AC 368 ms
80,172 KB
testcase_18 AC 499 ms
80,556 KB
testcase_19 AC 497 ms
80,712 KB
testcase_20 AC 503 ms
80,660 KB
testcase_21 AC 507 ms
80,856 KB
testcase_22 AC 368 ms
80,312 KB
testcase_23 AC 364 ms
80,080 KB
testcase_24 AC 486 ms
80,748 KB
testcase_25 AC 501 ms
80,464 KB
testcase_26 AC 496 ms
80,708 KB
testcase_27 AC 365 ms
80,316 KB
testcase_28 AC 367 ms
80,224 KB
testcase_29 AC 99 ms
80,168 KB
testcase_30 AC 367 ms
80,296 KB
testcase_31 AC 361 ms
80,184 KB
testcase_32 AC 362 ms
80,164 KB
testcase_33 AC 364 ms
80,384 KB
testcase_34 AC 101 ms
80,116 KB
testcase_35 AC 361 ms
80,168 KB
testcase_36 AC 365 ms
80,164 KB
testcase_37 AC 364 ms
80,408 KB
testcase_38 AC 497 ms
80,856 KB
testcase_39 AC 495 ms
80,484 KB
testcase_40 AC 497 ms
80,904 KB
testcase_41 AC 362 ms
80,296 KB
testcase_42 AC 498 ms
80,744 KB
testcase_43 AC 364 ms
80,172 KB
testcase_44 AC 502 ms
80,860 KB
testcase_45 AC 503 ms
80,572 KB
testcase_46 AC 369 ms
80,156 KB
testcase_47 AC 508 ms
80,796 KB
testcase_48 AC 366 ms
80,316 KB
testcase_49 AC 103 ms
80,012 KB
testcase_50 AC 367 ms
80,312 KB
testcase_51 AC 367 ms
80,328 KB
testcase_52 AC 370 ms
80,332 KB
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 AC 368 ms
80,316 KB
testcase_57 AC 365 ms
80,056 KB
testcase_58 AC 368 ms
80,372 KB
testcase_59 AC 371 ms
80,364 KB
testcase_60 AC 365 ms
80,376 KB
testcase_61 AC 367 ms
80,072 KB
testcase_62 AC 370 ms
80,164 KB
testcase_63 AC 368 ms
80,168 KB
testcase_64 AC 363 ms
80,452 KB
testcase_65 AC 451 ms
80,436 KB
testcase_66 AC 365 ms
80,480 KB
testcase_67 AC 463 ms
80,624 KB
testcase_68 AC 368 ms
80,364 KB
testcase_69 AC 363 ms
80,224 KB
testcase_70 AC 369 ms
80,528 KB
testcase_71 AC 480 ms
80,808 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