結果

問題 No.825 賢いお買い物
ユーザー tomarint2
提出日時 2019-05-03 22:53:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 380 bytes
コンパイル時間 465 ms
コンパイル使用メモリ 82,420 KB
実行使用メモリ 64,300 KB
最終ジャッジ日時 2024-12-31 18:54:25
合計ジャッジ時間 2,475 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

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