結果
問題 | No.183 たのしい排他的論理和(EASY) |
ユーザー | fukafukatani |
提出日時 | 2018-11-04 14:08:41 |
言語 | Rust (1.77.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 738 bytes |
コンパイル時間 | 13,973 ms |
コンパイル使用メモリ | 401,876 KB |
実行使用メモリ | 10,696 KB |
最終ジャッジ日時 | 2024-04-30 21:44:37 |
合計ジャッジ時間 | 21,058 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,816 KB |
testcase_01 | AC | 1 ms
6,812 KB |
testcase_02 | AC | 2 ms
6,816 KB |
testcase_03 | AC | 1 ms
6,944 KB |
testcase_04 | AC | 1 ms
6,940 KB |
testcase_05 | AC | 4 ms
6,940 KB |
testcase_06 | AC | 1 ms
6,940 KB |
testcase_07 | TLE | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
ソースコード
fn read<T: std::str::FromStr>() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() } fn read_vec<T: std::str::FromStr>() -> Vec<T> { read::<String>().split_whitespace() .map(|e| e.parse().ok().unwrap()).collect() } fn main() { let _: usize = read(); let bs: Vec<usize> = read_vec(); let mut dp = std::collections::HashSet::new(); dp.insert(0); for b in bs { let mut results = std::collections::HashSet::new(); for num in &dp { let result = num ^ b; results.insert(result); } for result in results { dp.insert(result); } } println!("{:?}", dp.len()); }