結果
| 問題 | No.825 賢いお買い物 | 
| コンテスト | |
| ユーザー |  lllllll88938494 | 
| 提出日時 | 2022-01-21 04:02:12 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 58 ms / 2,000 ms | 
| コード長 | 560 bytes | 
| コンパイル時間 | 229 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 10,880 KB | 
| 最終ジャッジ日時 | 2024-11-24 18:23:20 | 
| 合計ジャッジ時間 | 1,900 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 19 | 
ソースコード
a,b,c= map(int,input().split())
total=a+b*10
ans=10**10
def  otsuri(x):
    ot_b,ot_a=divmod(x,10)
    return ot_b,ot_a
for cb in range(b+1):
    pb = cb*10
    for pa in range(a+1):
        shiharai = pa+pb
        nokorimaisu1 = (a - pa) + (b - cb) 
        for kakaku in range(1,shiharai+1):
            x = shiharai-kakaku
            ot_b , ot_a = otsuri(x)
            nokorimaisu2 = nokorimaisu1+ot_b+ot_a
            
            if nokorimaisu2 == c:
                ans=min(kakaku,ans)
if ans==10**10:
    print("Impossible")
else:
    print(ans)
            
            
            
        