結果

問題 No.183 たのしい排他的論理和(EASY)
コンテスト
ユーザー hanorver
提出日時 2015-11-12 18:57:21
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 5,000 ms
+ 418µs
コード長 390 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 252 ms
コンパイル使用メモリ 71,856 KB
実行使用メモリ 9,780 KB
最終ジャッジ日時 2026-10-12 14:37:07
合計ジャッジ時間 1,543 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<iostream>

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

	const int max = 1 << 15;
	bool ans[max] = {true};
	for (int i = 0; i < switches; i++) {
		int n;
		std::cin >> n;
		if(!ans[n]){
			for (int j = 0; j < max; j++) {
				if(ans[j]) ans[j ^ n] = true;
			}
		}
	}

	int a = 0;
	for (int i = 0; i < max; i++) {
		a += ans[i];
	}

	std::cout << a << std::endl;
	return 0;
}
0