結果
| 問題 | 
                            No.669 対決!!! 飲み比べ
                             | 
                    
| コンテスト | |
| ユーザー | 
                             fukafukatani
                         | 
                    
| 提出日時 | 2019-02-04 22:46:12 | 
| 言語 | Rust  (1.83.0 + proconio)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 1 ms / 2,000 ms | 
| コード長 | 745 bytes | 
| コンパイル時間 | 15,093 ms | 
| コンパイル使用メモリ | 378,060 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-26 02:18:33 | 
| 合計ジャッジ時間 | 13,303 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 25 | 
ソースコード
#[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<u64> = read_vec();
    let (_, k) = (v[0], v[1]);
    let a: Vec<u64> = read_vec();
    let grundy = a.iter().map(|x| x % (k + 1)).collect::<Vec<_>>();
    let mut nim = 0;
    for num in grundy {
        nim ^= num;
    }
    if nim == 0 {
        println!("NO");
    } else {
        println!("YES");
    }
}
            
            
            
        
            
fukafukatani