use std::str::FromStr; use std::{io::*, vec}; fn main() { let n: usize = read(); let mut count = 0; let mut a = vec![0; n]; for _i in &mut a { *_i = read(); } let mut dp = vec![false; 100000]; dp[0] = true; for _ in 0..n { for _i in 0..100000 { for _j in &mut a { if dp[_i] { dp[_i ^ *_j] = true; } } } } for _i in &mut dp { if *_i { count += 1; } } println!("{}", count); } pub fn read() -> T { let stdin = stdin(); let stdin = stdin.lock(); let token: String = stdin .bytes() .map(|c| c.expect("failed to read char") as char) .skip_while(|c| c.is_whitespace()) .take_while(|c| !c.is_whitespace()) .collect(); token.parse().ok().expect("failed to parse token") }