結果

問題 No.825 賢いお買い物
ユーザー titiy
提出日時 2019-05-24 13:46:28
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 401 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-09-17 10:06:14
合計ジャッジ時間 1,592 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c=map(int,input().split())
d=a+b
ans=[]
for A in range(a+1):
    for B in range(b+1):

        if d-A-B==c:
            ans+=[A+B*10]
while a>10:
    a-=10
    b+=1
    d=a+b
    for A in range(a+1):
        for B in range(b+1):
            if d-A-B==c:
                ans+=[A+B*10]
if ans==[]:
    print("Impossible")
    exit()
if max(ans)>0:

    print(min(ans))

else:
    print("Impossible")
0