結果

問題 No.825 賢いお買い物
ユーザー OhnumaOhnuma
提出日時 2020-04-10 20:16:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 36 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 10,560 KB
実行使用メモリ 8,224 KB
最終ジャッジ日時 2023-10-13 16:22:27
合計ジャッジ時間 2,587 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,032 KB
testcase_01 AC 16 ms
8,224 KB
testcase_02 AC 22 ms
7,788 KB
testcase_03 AC 19 ms
7,848 KB
testcase_04 AC 22 ms
7,768 KB
testcase_05 AC 17 ms
8,204 KB
testcase_06 AC 15 ms
7,760 KB
testcase_07 AC 18 ms
7,760 KB
testcase_08 AC 36 ms
8,152 KB
testcase_09 AC 16 ms
7,744 KB
testcase_10 AC 25 ms
7,920 KB
testcase_11 AC 30 ms
8,064 KB
testcase_12 AC 16 ms
8,072 KB
testcase_13 AC 15 ms
7,768 KB
testcase_14 AC 15 ms
7,960 KB
testcase_15 AC 27 ms
8,092 KB
testcase_16 AC 26 ms
8,048 KB
testcase_17 AC 15 ms
8,200 KB
testcase_18 AC 35 ms
8,048 KB
testcase_19 AC 20 ms
8,040 KB
testcase_20 AC 16 ms
7,956 KB
testcase_21 AC 15 ms
8,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c = map(int,input().split())
for i in range(1, 10*b+a+1):
    for j in range(a+1):
        for k in range(b+1):
            if k*10+j < i:
                continue
            t = 10*k+j - i
            tb = t//10
            ta = t - tb*10
            if ta+tb+(b-k)+(a-j)==c:
                print(i)
                exit()
print('Impossible')
0