結果
| 問題 | No.734 Careful Engineer |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-02-07 13:22:06 |
| 言語 | Rust (1.93.0 + proconio + num + itertools) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 753 bytes |
| 記録 | |
| コンパイル時間 | 17,754 ms |
| コンパイル使用メモリ | 196,152 KB |
| 実行使用メモリ | 7,976 KB |
| 最終ジャッジ日時 | 2026-02-07 13:22:26 |
| 合計ジャッジ時間 | 3,405 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 13 |
ソースコード
fn main() {
let stdin = std::io::read_to_string(std::io::stdin()).unwrap();
let mut stdin = stdin.split_ascii_whitespace();
let a: u32 = stdin.next().unwrap().parse().unwrap();
let b: u32 = stdin.next().unwrap().parse().unwrap();
let c: u32 = stdin.next().unwrap().parse().unwrap();
println!("{}", output(solve(a, b, c)));
}
fn solve(a: u32, b: u32, c: u32) -> Option<u64> {
match a as u64 * 60 <= b as u64 {
true => None,
false => {
let cost_cut = a as u64 * 60 - b as u64;
Some((c as u64 * 3600 + cost_cut - 1) / cost_cut)
}
}
}
fn output(ans: Option<u64>) -> String {
match ans {
Some(ans) => ans.to_string(),
None => String::from("-1"),
}
}