結果
| 問題 | No.183 たのしい排他的論理和(EASY) |
| コンテスト | |
| ユーザー |
hanorver
|
| 提出日時 | 2015-11-12 18:57:21 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 390 bytes |
| 記録 | |
| コンパイル時間 | 428 ms |
| コンパイル使用メモリ | 72,260 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-18 22:37:27 |
| 合計ジャッジ時間 | 914 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
#include<iostream>
int main() {
int switches;
std::cin >> switches;
const int max = 1 << 15;
bool ans[max] = {true};
for (int i = 0; i < switches; i++) {
int n;
std::cin >> n;
if(!ans[n]){
for (int j = 0; j < max; j++) {
if(ans[j]) ans[j ^ n] = true;
}
}
}
int a = 0;
for (int i = 0; i < max; i++) {
a += ans[i];
}
std::cout << a << std::endl;
return 0;
}
hanorver