結果
問題 |
No.3064 Speedrun (Easy)
|
ユーザー |
|
提出日時 | 2025-03-22 07:33:26 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 2,506 bytes |
コンパイル時間 | 15,756 ms |
コンパイル使用メモリ | 379,136 KB |
実行使用メモリ | 5,888 KB |
最終ジャッジ日時 | 2025-03-22 07:33:43 |
合計ジャッジ時間 | 14,023 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 |
ソースコード
fn main() { // A1つをP分、 // B1つをQ分、 // C1つをR分、 // D1つをS分 // A*P+B*Q+C*R+D*S <= Tかを判定する let abcd : Vec<usize> = read_numbers_vec(4); let pqrst : Vec<usize> = read_numbers_vec(5); let mut time = 0; for i in 0..4 { time += abcd[i] * pqrst[i]; } println!("{}", if time <= pqrst[4] {"Yes"} else {"No"}); } // ---------- start input macro ---------- // const MOD17: usize = 1000000007; // const MOD93: usize = 998244353; // const INF: usize = 1 << 60; // let dx = vec![!0, 0, 1, 0]; // 上左下右 // let dy = vec![0, !0, 0, 1]; // 上左下右 // let d = vec!{(!0, 0), (0, !0), (1, 0), (0, 1)}; // 上左下右 #[allow(unused)] use std::{ io, io::stderr, io::stdin, io::BufRead, io::Write, str::FromStr, mem::swap, cmp::min, cmp::max, cmp::Reverse, collections::HashSet, collections::BTreeSet, collections::HashMap, collections::BTreeMap, collections::BinaryHeap, collections::VecDeque, }; // usizeで受け取り #[allow(unused)] fn read_usize() -> usize { let mut input = String::new(); io::stdout().flush().unwrap(); // 出力バッファをフラッシュ io::stdin().read_line(&mut input).unwrap(); input.trim().parse().unwrap() } // 数値型を配列で受け取り #[allow(unused)] fn read_numbers_vec<T>(n: usize) -> Vec<T> where T: FromStr, <T as FromStr>::Err: std::fmt::Debug, { let mut input = String::new(); io::stdout().flush().unwrap(); io::stdin().read_line(&mut input).unwrap(); input.trim() .split_whitespace() // 空白区切りで分割 .take(n) // 指定された個数分だけ取り出す .map(|s| s.parse().unwrap()) // 各値をTに変換 .collect() // ベクターとして収集 } // char型配列で受け取り #[allow(unused)] fn read_char_array() -> Vec<char> { let mut input = String::new(); io::stdout().flush().unwrap(); io::stdin().read_line(&mut input).unwrap(); input.trim().chars().collect() } // 文字列型で受け取り #[allow(unused)] fn read_string() -> String { let mut input = String::new(); io::stdout().flush().unwrap(); io::stdin().read_line(&mut input).unwrap(); input.trim().to_string() } // 配列のスペース区切り出力 #[allow(unused)] fn vec_print<T: std::fmt::Display>(vec: &Vec<T>) { let sz = vec.len(); for i in 0..sz-1 { print!("{} ", vec[i]); } println!("{}", vec[sz-1]); } // ---------- end input macro ----------