結果

問題 No.825 賢いお買い物
ユーザー calei
提出日時 2020-01-21 23:48:08
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 371 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-06 12:44:09
合計ジャッジ時間 1,443 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

# yukicoder No.825 賢いお買い物 2020/01/21

a,b,c=map(int,input().split())
if a+b<c and b<1:
    print('Impossible')
    exit()
else:
    rm=(a+b)-c
    if rm<0:
        n=10-(-rm+1)
        ans=n
    else:
        aa=min(a,rm)
        bb=10*(max(0,rm-a))
        if a>aa>=10:
            aa-=10-1
        ans=aa+bb
if ans<1:
    print('Impossible')
else:print(ans)
0