結果
問題 | No.669 対決!!! 飲み比べ |
ユーザー |
|
提出日時 | 2023-01-01 22:43:28 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 556 bytes |
コンパイル時間 | 13,211 ms |
コンパイル使用メモリ | 378,752 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 00:24:03 |
合計ジャッジ時間 | 12,748 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 25 |
コンパイルメッセージ
warning: unused variable: `n` --> src/main.rs:6:9 | 6 | let n = nk[0]; | ^ help: if this is intentional, prefix it with an underscore: `_n` | = note: `#[warn(unused_variables)]` on by default
ソースコード
fn main() {let mut nk = String::new();std::io::stdin().read_line(&mut nk).ok();let nk: Vec<usize> = nk.trim().split_whitespace().map(|s| s.parse().unwrap()).collect();let n = nk[0];let k = nk[1];let mut a = String::new();std::io::stdin().read_line(&mut a).ok();let a: Vec<usize> = a.trim().split_whitespace().map(|s| s.parse().unwrap()).collect();let result = a.iter().map(|&v| v % (k + 1)).fold(0usize, |x, y| x ^ y);if result == 0 {println!("NO");} else {println!("YES");}}