結果

問題 No.825 賢いお買い物
ユーザー nebukuro09nebukuro09
提出日時 2019-05-03 21:29:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 353 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,560 KB
実行使用メモリ 8,256 KB
最終ジャッジ日時 2023-08-30 05:56:07
合計ジャッジ時間 1,523 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,076 KB
testcase_01 AC 16 ms
8,144 KB
testcase_02 AC 23 ms
8,024 KB
testcase_03 AC 19 ms
7,876 KB
testcase_04 AC 23 ms
7,968 KB
testcase_05 AC 17 ms
8,148 KB
testcase_06 AC 16 ms
7,804 KB
testcase_07 AC 17 ms
7,900 KB
testcase_08 AC 32 ms
8,188 KB
testcase_09 AC 17 ms
7,848 KB
testcase_10 AC 24 ms
7,808 KB
testcase_11 AC 29 ms
8,232 KB
testcase_12 AC 16 ms
8,144 KB
testcase_13 AC 16 ms
7,968 KB
testcase_14 AC 15 ms
8,112 KB
testcase_15 AC 25 ms
8,256 KB
testcase_16 AC 24 ms
8,236 KB
testcase_17 AC 15 ms
8,244 KB
testcase_18 AC 33 ms
8,136 KB
testcase_19 AC 19 ms
8,100 KB
testcase_20 AC 16 ms
8,184 KB
testcase_21 AC 16 ms
8,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for i in range(1, A + 10 * B + 1):
    for a in range(A+1):
        for b in range(B+1):
            if a + 10 * b < i:
                continue
            c = a + 10 * b - i
            c = c % 10 + c // 10 + A - a + B - b
            if c == C:
                print(i)
                exit()
print ("Impossible")
0