結果
| 問題 | No.825 賢いお買い物 |
| コンテスト | |
| ユーザー |
_KingdomOfMoray
|
| 提出日時 | 2019-12-25 08:07:20 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 104 ms / 2,000 ms |
| コード長 | 430 bytes |
| 記録 | |
| コンパイル時間 | 376 ms |
| コンパイル使用メモリ | 20,572 KB |
| 実行使用メモリ | 15,232 KB |
| 最終ジャッジ日時 | 2026-04-11 16:14:10 |
| 合計ジャッジ時間 | 3,670 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 |
ソースコード
a, b, c = list(map(int,input().split()))
candidate = []
for i in range(a+1):
for j in range(b+1):
output = 1 * i + 10 * j
for price in range(1, output+1):
num_coins = (output - price) // 10 + (output - price) % 10
if num_coins + (a-i) + (b-j) == c:
candidate.append(price)
if len(candidate) == 0:
print('Impossible')
else:
print(min(candidate))
_KingdomOfMoray