結果
| 問題 |
No.183 たのしい排他的論理和(EASY)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-04-17 02:05:25 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 11 ms / 5,000 ms |
| コード長 | 406 bytes |
| コンパイル時間 | 469 ms |
| コンパイル使用メモリ | 68,164 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-29 01:44:10 |
| 合計ジャッジ時間 | 1,142 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <set>
using namespace std;
int main() {
int n, in;
cin >> n;
set<int> a;
a.insert(0);
for (int i = 0; i < n; i++) {
cin >> in;
if (a.count(in) > 0) {
continue;
}
for (auto it = a.begin(); it != a.end(); it++) {
a.insert(*it ^ in);
}
}
cout << a.size() << endl;
return 0;
}