結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー mannshi222mannshi222
提出日時 2022-04-29 18:19:56
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 576 bytes
コンパイル時間 1,041 ms
コンパイル使用メモリ 82,660 KB
実行使用メモリ 6,884 KB
最終ジャッジ日時 2023-09-11 08:58:53
合計ジャッジ時間 24,845 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 4 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 8 ms
4,872 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 4,723 ms
6,576 KB
testcase_08 AC 4,892 ms
5,040 KB
testcase_09 AC 3,338 ms
5,084 KB
testcase_10 AC 4,047 ms
5,164 KB
testcase_11 TLE -
testcase_12 AC 12 ms
6,624 KB
testcase_13 AC 2 ms
4,384 KB
testcase_14 AC 3 ms
4,380 KB
testcase_15 TLE -
testcase_16 AC 2 ms
4,384 KB
testcase_17 AC 1,248 ms
4,948 KB
testcase_18 AC 4,739 ms
6,884 KB
testcase_19 AC 629 ms
5,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <set>
#include <string>

using namespace std;

int main()
{
	int N;
	cin >> N;
	set<int> A;
	for( int i = 0; i < N; i++ ) {
		int tmp;
		cin >> tmp;
		A.insert(tmp);
	}
	set<int> dp;
	dp.insert(0);
	
	for( auto itr  = A.begin(); itr != A.end(); itr++ ) {
		set<int> tmp = dp;
		for( auto itr2  = dp.begin(); itr2 != dp.end(); itr2++ ) {
			tmp.insert( (*itr) ^ (*itr2) );
		}
		dp = tmp;
    }

	/*
	for( auto itr  = dp.begin(); itr != dp.end(); itr++ ) {
		cout << *itr << endl;
	}
	/**/
	cout << dp.size() << endl;
	return 0;
}
0