結果

問題 No.825 賢いお買い物
ユーザー _KingdomOfMoray_KingdomOfMoray
提出日時 2019-12-25 08:07:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 11,840 KB
実行使用メモリ 10,116 KB
最終ジャッジ日時 2023-10-24 18:04:29
合計ジャッジ時間 1,872 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,100 KB
testcase_01 AC 48 ms
10,116 KB
testcase_02 AC 32 ms
10,100 KB
testcase_03 AC 27 ms
10,100 KB
testcase_04 AC 31 ms
10,100 KB
testcase_05 AC 33 ms
10,100 KB
testcase_06 AC 27 ms
10,100 KB
testcase_07 AC 27 ms
10,100 KB
testcase_08 AC 36 ms
10,100 KB
testcase_09 AC 26 ms
10,100 KB
testcase_10 AC 31 ms
10,100 KB
testcase_11 AC 36 ms
10,100 KB
testcase_12 AC 29 ms
10,100 KB
testcase_13 AC 29 ms
10,100 KB
testcase_14 AC 28 ms
10,100 KB
testcase_15 AC 32 ms
10,100 KB
testcase_16 AC 35 ms
10,100 KB
testcase_17 AC 27 ms
10,100 KB
testcase_18 AC 35 ms
10,100 KB
testcase_19 AC 28 ms
10,100 KB
testcase_20 AC 26 ms
10,100 KB
testcase_21 AC 27 ms
10,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b, c = list(map(int,input().split()))

candidate = []
for i in range(a+1):
    for j in range(b+1):
        output = 1 * i + 10 * j
        for price in range(1, output+1):
            num_coins = (output - price) // 10 + (output - price) % 10
            if num_coins + (a-i) + (b-j) == c:
                candidate.append(price)
                
if len(candidate) == 0:
    print('Impossible')
else:
    print(min(candidate))
0