結果

問題 No.176 2種類の切手
ユーザー titiatitia
提出日時 2022-05-02 00:23:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 186 ms / 1,000 ms
コード長 221 bytes
コンパイル時間 115 ms
コンパイル使用メモリ 10,712 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2023-09-13 17:48:13
合計ジャッジ時間 4,542 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
7,796 KB
testcase_01 AC 117 ms
7,960 KB
testcase_02 AC 111 ms
7,828 KB
testcase_03 AC 46 ms
7,792 KB
testcase_04 AC 47 ms
7,832 KB
testcase_05 AC 44 ms
7,760 KB
testcase_06 AC 43 ms
7,816 KB
testcase_07 AC 48 ms
7,956 KB
testcase_08 AC 47 ms
7,792 KB
testcase_09 AC 45 ms
7,764 KB
testcase_10 AC 47 ms
7,744 KB
testcase_11 AC 47 ms
7,820 KB
testcase_12 AC 49 ms
7,852 KB
testcase_13 AC 48 ms
7,760 KB
testcase_14 AC 45 ms
7,744 KB
testcase_15 AC 49 ms
7,928 KB
testcase_16 AC 45 ms
7,920 KB
testcase_17 AC 49 ms
7,716 KB
testcase_18 AC 43 ms
7,776 KB
testcase_19 AC 42 ms
7,788 KB
testcase_20 AC 44 ms
7,848 KB
testcase_21 AC 181 ms
7,832 KB
testcase_22 AC 186 ms
7,820 KB
testcase_23 AC 177 ms
7,776 KB
testcase_24 AC 46 ms
7,712 KB
testcase_25 AC 45 ms
7,972 KB
testcase_26 AC 178 ms
7,788 KB
testcase_27 AC 47 ms
7,776 KB
testcase_28 AC 47 ms
7,796 KB
testcase_29 AC 75 ms
7,788 KB
testcase_30 AC 49 ms
7,784 KB
testcase_31 AC 118 ms
7,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B,T=map(int,input().split())
ANS=1<<100

for i in range(10**5):
    if T-A*i>=0:
        j=(T-A*i+B-1)//B
        ANS=min(ANS,A*i+B*j)

    if T-B*i>=0:
        j=(T-B*i+A-1)//A
        ANS=min(ANS,B*i+A*j)

print(ANS)
0