結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー kazuma
提出日時 2017-07-26 13:22:36
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 423 bytes
コンパイル時間 2,320 ms
コンパイル使用メモリ 196,600 KB
最終ジャッジ日時 2025-01-05 01:52:10
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15 WA * 3
権限があれば一括ダウンロードができます

ソースコード

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] && (i ^ a) <= (1 << 14)) {
				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