結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー Goryudyuma
提出日時 2015-04-21 12:13:27
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1,957 ms / 5,000 ms
コード長 470 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 71,060 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-29 01:48:55
合計ジャッジ時間 13,798 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <set>
#include <algorithm>

using namespace std;

int main()
{
	set<int>data, data2;
	vector<int>data3;
	data.insert(0);
	int N, a;
	cin >> N;
	for (size_t i = 0; i < N; i++)
	{
		cin >> a;
		data.insert(a);
	}
	data2.insert(0);
	for (auto x : data)
	{
		for (auto y : data2)
		{
			data3.push_back(x^y);
		}
		for (auto y : data3)
		{
			data2.insert(y);
		}
		data3.clear();
	}
	cout << data2.size() << endl;
	return 0;
}
0