結果
| 問題 |
No.1517 Party Location
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-05 10:42:58 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 480 bytes |
| コンパイル時間 | 18,192 ms |
| コンパイル使用メモリ | 400,884 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-31 09:47:36 |
| 合計ジャッジ時間 | 13,375 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 |
ソースコード
fn main() {
let mut d = String::new();
std::io::stdin().read_line(&mut d).ok();
let d: usize = d.trim().parse().unwrap();
let mut ab = String::new();
std::io::stdin().read_line(&mut ab).ok();
let ab: Vec<usize> = ab.trim().split_whitespace().map(|s| s.parse().unwrap()).collect();
let a = ab[0];
let b = ab[1];
let mut result = 1usize << 60;
for i in 0..=d {
result = result.min(a*i + (d-i)*b);
}
println!("{}", result);
}