結果

問題 No.825 賢いお買い物
コンテスト
ユーザー tomarint2
提出日時 2019-05-03 22:53:34
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 43 ms / 2,000 ms
+ 611µs
コード長 380 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 950 ms
コンパイル使用メモリ 65,164 KB
実行使用メモリ 59,540 KB
最終ジャッジ日時 2026-10-13 10:54:46
合計ジャッジ時間 2,685 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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