結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー MayimgMayimg
提出日時 2018-11-25 16:37:10
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 433 bytes
コンパイル時間 1,865 ms
コンパイル使用メモリ 165,892 KB
実行使用メモリ 5,272 KB
最終ジャッジ日時 2023-08-26 05:10:56
合計ジャッジ時間 7,833 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int n; cin >> n;
	vector<bool> dp(1 << 14 + 1);
	dp[0] = true;
	int a;
	for(int i = 0; i < n; i++) {
		scanf("%d", &a);
		for(int j = 0; j < dp.size(); j++) {
			if(dp[j]) dp[a ^ j] = true;
		}
	}
	int ans = 0;
	for(int i = 0; i < dp.size(); i++) {
		if(dp[i]) ans++;
	}
	cout << ans << endl;
	return 0;
}
0