結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー masamasa
提出日時 2015-04-16 23:55:03
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 510 bytes
コンパイル時間 521 ms
コンパイル使用メモリ 70,080 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-17 21:18:12
合計ジャッジ時間 12,792 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 TLE -
testcase_03 AC 349 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

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