結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー masa
提出日時 2015-04-16 23:55:03
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 510 bytes
コンパイル時間 603 ms
コンパイル使用メモリ 69,332 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-04 15:15:12
合計ジャッジ時間 11,646 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 3 TLE * 1 -- * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

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

using namespace std;

int main() {
	int n, in;

	cin >> n;
	set<long long> a, b;
	a.insert(0);
	for (int i = 0; i < n; i++) {
		cin >> in;
		a.insert(in);
	}

	while(a.size() != b.size()) {
		b = a;
		for (auto it1 = b.begin(); it1 != b.end(); it1++) {
			auto it2 = it1;
			it2++;
			for (; it2 != b.end(); it2++) {
					a.insert(*it1 ^ *it2);
			}
		}
	}

	cout << a.size() << endl;
	return 0;
}
0