結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー taotao54321taotao54321
提出日時 2018-10-13 21:26:12
言語 Rust
(1.77.0)
結果
RE  
実行時間 -
コード長 702 bytes
コンパイル時間 637 ms
コンパイル使用メモリ 166,544 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-20 20:11:23
合計ジャッジ時間 2,140 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 RE -
testcase_08 AC 98 ms
5,376 KB
testcase_09 AC 66 ms
5,376 KB
testcase_10 AC 80 ms
5,376 KB
testcase_11 AC 107 ms
5,376 KB
testcase_12 RE -
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 100 ms
5,376 KB
testcase_15 AC 110 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 25 ms
5,376 KB
testcase_18 RE -
testcase_19 AC 13 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#![allow(non_snake_case)]

use std::io::{ self, prelude::* };

macro_rules! pick {
    ($tokens:expr) => {
        $tokens.next().unwrap().parse().expect("parse error")
    }
}

fn main() {
    let mut s = String::new();
    io::stdin().read_to_string(&mut s).expect("i/o error");
    let mut tokens = s.split_whitespace();

    let N: usize    = pick!(tokens);
    let A: Vec<u32> = (0..N).map(|_| pick!(tokens)).collect();

    let mut v = [false; 16385];
    v[0] = true;

    for a in A {
        for i in 0..=16384 {
            if v[i as usize] {
                v[(a^i) as usize] = true;
            }
        }
    }

    let ans = v.iter().filter(|&&x| x).count();

    println!("{}", ans);
}
0