結果
問題 | No.183 たのしい排他的論理和(EASY) |
ユーザー |
|
提出日時 | 2024-08-05 15:22:38 |
言語 | Rust (1.83.0 + proconio) |
結果 |
RE
|
実行時間 | - |
コード長 | 534 bytes |
コンパイル時間 | 14,400 ms |
コンパイル使用メモリ | 401,660 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-08-05 15:22:54 |
合計ジャッジ時間 | 15,037 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 RE * 3 |
コンパイルメッセージ
warning: unused import: `HashMap` --> src/main.rs:1:24 | 1 | use std::collections::{HashMap, HashSet}; | ^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
ソースコード
use std::collections::{HashMap, HashSet};fn main() {proconio::input! {n: u64,a: [u64; n],}let a: HashSet<u64> = HashSet::from_iter(a);let mut dp = vec![false; 16384]; // 2^14dp[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());}