結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー kazumakazuma
提出日時 2017-07-26 13:21:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 399 bytes
コンパイル時間 2,341 ms
コンパイル使用メモリ 196,972 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 23:59:20
合計ジャッジ時間 5,767 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

int main()
{
	int N;
	cin >> N;
	vector<bool> dp((1 << 14) + 1);
	dp[0] = true;
	for (int i = 0, a; i < N; i++) {
		cin >> a;
		auto tdp = dp;
		for (int i = 0; i <= 1 << 14; i++) {
			if (tdp[i]) {
				dp[i ^ a] = true;
			}
		}
	}
	int res = 0;
	for (int i = 0; i <= 1 << 14; i++) {
		if (dp[i]) {
			res++;
		}
	}
	cout << res << endl;
	return 0;
}
0