結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー hanorverhanorver
提出日時 2015-10-30 13:25:13
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 555 bytes
コンパイル時間 494 ms
コンパイル使用メモリ 66,964 KB
実行使用メモリ 8,036 KB
最終ジャッジ日時 2023-10-11 05:38:53
合計ジャッジ時間 7,241 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 TLE -
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<vector>
#include<set>

int main() {
	int switches;
	std::cin >> switches;

	std::set<int> v;
	for (int i = 0; i < switches;i++){
		int num;
		std::cin >> num;
		v.insert(num);
	}

	std::set<int> s;
	s.insert(0);
	std::set<int>::iterator it = v.begin();
	for (int i = 0; i < v.size(); i++) {
		for (int j = i; j < v.size(); j++) {
			int n = 0;
			std::set<int>::iterator it2 = it;
			for (int k = i; k <= j; k++) {
				n ^= *it2;
				it2++;
			}
			s.insert(n);
		}
		it++;
	}

	std::cout << s.size() << std::endl;
	return 0;
}
0