結果
問題 |
No.183 たのしい排他的論理和(EASY)
|
ユーザー |
|
提出日時 | 2020-04-25 16:13:53 |
言語 | Rust (1.83.0 + proconio) |
結果 |
RE
|
実行時間 | - |
コード長 | 612 bytes |
コンパイル時間 | 14,808 ms |
コンパイル使用メモリ | 378,976 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 06:41:49 |
合計ジャッジ時間 | 14,757 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 2 RE * 16 |
ソースコード
use std::io::*; fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let n: usize = itr.next().unwrap().parse().unwrap(); let a: Vec<usize> = (0..n) .map(|_| itr.next().unwrap().parse().unwrap()) .collect(); let mut dp: Vec<bool> = vec![false; 20000]; dp[0] = true; for i in 0..n { for j in (0..18000).rev() { dp[j ^ a[i]] |= dp[j]; } } let mut ans = 0; for i in 0..18000 { ans += dp[i] as usize; } println!("{}", ans); }