結果

問題 No.825 賢いお買い物
コンテスト
ユーザー tomarint2
提出日時 2019-05-03 22:53:34
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 380 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 707 ms
コンパイル使用メモリ 85,248 KB
実行使用メモリ 63,360 KB
最終ジャッジ日時 2026-06-05 08:10:56
合計ジャッジ時間 2,176 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

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