結果
| 問題 |
No.1456 Range Xor
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-20 16:36:30 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 14 ms / 2,000 ms |
| コード長 | 408 bytes |
| コンパイル時間 | 12,359 ms |
| コンパイル使用メモリ | 403,628 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-20 16:36:46 |
| 合計ジャッジ時間 | 15,358 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 46 |
ソースコード
use std::{collections::HashSet, io::Read};
fn main() {
let mut s = String::new();
std::io::stdin().read_to_string(&mut s).ok();
let v: Vec<usize> = s.split_whitespace().flat_map(str::parse).collect();
let mut t = 0;
let mut h = HashSet::from([t]);
for &a in &v[2..] {
t ^= a;
h.insert(t);
}
println!(
"{}",
if h.iter().any(|x| h.contains(&(x ^ v[1]))) {
"Yes"
} else {
"No"
}
)
}