use std::collections::{HashMap, HashSet}; fn main() { proconio::input! { n: u64, a: [u64; n], } let a: HashSet = HashSet::from_iter(a); let mut dp = vec![false; 16384]; // 2^14 dp[0] = true; for &a in a.iter() { let mut next_dp = dp.clone(); for i in 0..dp.len() { if !dp[i] { continue; } next_dp[i ^ a as usize] = true; } dp = next_dp; } println!("{}", dp.into_iter().filter(|&x| x).count()); }