結果
| 問題 |
No.825 賢いお買い物
|
| コンテスト | |
| ユーザー |
ID 21712
|
| 提出日時 | 2025-01-09 23:14:42 |
| 言語 | Go (1.23.4) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 455 bytes |
| コンパイル時間 | 17,005 ms |
| コンパイル使用メモリ | 241,824 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2025-01-09 23:15:07 |
| 合計ジャッジ時間 | 18,559 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 |
ソースコード
package main
import . "fmt"
func main() {
var a,b,c int
Scan(&a,&b,&c)
ans:=int(1e9)
for price:=1;price<=a+b*10;price++ {
for pa:=0;pa<=a;pa++ {
for pb:=0;pb<=b;pb++ {
paid:=pa+pb*10
if paid<price {
continue
}
back:=paid-price
coin:=(a-pa)+(b-pb)+back/10+back%10
if coin!=c {
continue
}
if price<ans {
ans=price
}
}
}
}
if ans<1e9 {
Println(ans)
} else {
Println("Impossible")
}
}
ID 21712