結果
問題 | No.669 対決!!! 飲み比べ |
ユーザー |
![]() |
提出日時 | 2019-02-04 22:36:28 |
言語 | Rust (1.83.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 743 bytes |
コンパイル時間 | 27,493 ms |
コンパイル使用メモリ | 377,328 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 01:34:37 |
合計ジャッジ時間 | 13,718 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 WA * 5 |
コンパイルメッセージ
warning: unused variable: `n` --> src/main.rs:21:10 | 21 | let (n, k) = (v[0], v[1]); | ^ help: if this is intentional, prefix it with an underscore: `_n` | = note: `#[warn(unused_variables)]` on by default
ソースコード
#[allow(unused_imports)] use std::cmp::*; #[allow(unused_imports)] use std::collections::*; fn read<T: std::str::FromStr>() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() } fn read_vec<T: std::str::FromStr>() -> Vec<T> { read::<String>() .split_whitespace() .map(|e| e.parse().ok().unwrap()) .collect() } fn main() { let v: Vec<usize> = read_vec(); let (n, k) = (v[0], v[1]); let a: Vec<usize> = read_vec(); let grundy = a.iter().map(|x| x % k).collect::<Vec<_>>(); let mut nim = 0; for num in grundy { nim ^= num; } if nim == 0 { println!("NO"); } else { println!("YES"); } }