結果

問題 No.825 賢いお買い物
ユーザー tomarint2tomarint2
提出日時 2019-05-03 22:53:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 380 bytes
コンパイル時間 1,292 ms
コンパイル使用メモリ 86,568 KB
実行使用メモリ 76,328 KB
最終ジャッジ日時 2023-08-30 06:33:41
合計ジャッジ時間 3,415 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
75,588 KB
testcase_01 AC 86 ms
75,928 KB
testcase_02 AC 78 ms
76,076 KB
testcase_03 AC 76 ms
75,868 KB
testcase_04 AC 80 ms
76,076 KB
testcase_05 AC 82 ms
75,784 KB
testcase_06 AC 72 ms
71,300 KB
testcase_07 AC 78 ms
75,912 KB
testcase_08 AC 84 ms
76,172 KB
testcase_09 AC 77 ms
76,044 KB
testcase_10 AC 78 ms
76,004 KB
testcase_11 AC 84 ms
75,960 KB
testcase_12 AC 79 ms
75,936 KB
testcase_13 AC 71 ms
71,180 KB
testcase_14 AC 81 ms
75,864 KB
testcase_15 AC 85 ms
75,836 KB
testcase_16 AC 85 ms
75,896 KB
testcase_17 AC 79 ms
76,056 KB
testcase_18 AC 80 ms
76,328 KB
testcase_19 AC 80 ms
75,960 KB
testcase_20 AC 78 ms
76,052 KB
testcase_21 AC 75 ms
75,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B,C = map(int,input().split())
inf = 1 << 60
ans = inf
for a in range(A+1):
    for b in range(B+1):
        for i in range(1,221):
            if a+b*10 >= i:
                change = a+b*10 - i
                n = (A-a)+(B-b)+(change//10)+(change%10)
                if n == C:
                    ans = min(ans, i)
if ans == inf:
    print('Impossible')
else:
    print(ans)
0