結果

問題 No.825 賢いお買い物
ユーザー Takuya NoguchiTakuya Noguchi
提出日時 2021-07-21 00:28:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 2,457 ms
コンパイル使用メモリ 86,792 KB
実行使用メモリ 76,248 KB
最終ジャッジ日時 2023-09-24 13:00:45
合計ジャッジ時間 3,020 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,316 KB
testcase_01 AC 71 ms
71,036 KB
testcase_02 AC 81 ms
76,212 KB
testcase_03 AC 75 ms
75,968 KB
testcase_04 AC 75 ms
76,192 KB
testcase_05 AC 71 ms
75,760 KB
testcase_06 AC 71 ms
71,300 KB
testcase_07 AC 76 ms
76,180 KB
testcase_08 AC 78 ms
76,172 KB
testcase_09 AC 74 ms
75,792 KB
testcase_10 AC 76 ms
76,248 KB
testcase_11 AC 78 ms
76,244 KB
testcase_12 AC 74 ms
75,536 KB
testcase_13 AC 70 ms
71,252 KB
testcase_14 AC 71 ms
71,252 KB
testcase_15 AC 77 ms
76,132 KB
testcase_16 AC 76 ms
75,980 KB
testcase_17 AC 70 ms
71,272 KB
testcase_18 AC 79 ms
76,144 KB
testcase_19 AC 76 ms
76,084 KB
testcase_20 AC 70 ms
71,080 KB
testcase_21 AC 68 ms
71,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B, C = map(int, input().split())

for price in range(1, (A + B * 10) + 1):
    for a in range(A + 1):
        for b in range(B + 1):
            pay = a + 10 * b
            if pay < price:
                continue

            change = pay - price
            coin = (A - a + (change % 10)) + (B - b + (change // 10))
            if coin == C:
                print(price)
                exit()

print('Impossible')
0