結果
問題 | No.102 トランプを奪え |
ユーザー |
![]() |
提出日時 | 2019-02-07 21:52:04 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 619 bytes |
コンパイル時間 | 14,622 ms |
コンパイル使用メモリ | 378,164 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 04:57:51 |
合計ジャッジ時間 | 15,666 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 |
ソースコード
#[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 grundy = v.iter().map(|&x| x % 4).fold(0, |sum, x| sum ^ x); if grundy == 0 { println!("Jiro"); } else { println!("Taro"); } }