結果

問題 No.825 賢いお買い物
ユーザー first_vil
提出日時 2021-11-13 11:57:01
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-27 05:31:02
合計ジャッジ時間 2,728 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c = map(int,input().split())
ans = 1e9
s = a + b*10
def calc(x):
    return x//10 + x%10
for price in range(1,s+1):
    for pay in range(price,s+1):
        for c10 in range(b+1):
            if c10*10 > pay or pay - c10*10 > a:
                continue
            if b-c10 + a-(pay - c10*10) + calc(pay-price) == c:
                ans = min(ans, price)
if ans == 1e9:
    ans = "Impossible"
print(ans)
0