結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー kkslucy1kkslucy1
提出日時 2018-03-14 03:42:09
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 396 bytes
コンパイル時間 1,679 ms
コンパイル使用メモリ 157,912 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-03 16:46:38
合計ジャッジ時間 3,283 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 RE -
testcase_08 AC 67 ms
6,940 KB
testcase_09 AC 47 ms
6,940 KB
testcase_10 AC 56 ms
6,940 KB
testcase_11 AC 73 ms
6,940 KB
testcase_12 WA -
testcase_13 AC 1 ms
6,944 KB
testcase_14 AC 74 ms
6,944 KB
testcase_15 AC 76 ms
6,940 KB
testcase_16 AC 1 ms
6,940 KB
testcase_17 AC 18 ms
6,944 KB
testcase_18 RE -
testcase_19 AC 10 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
	int n, a[5000];
	cin >> n;
	for (int i = 0;i < n;i++) {
		cin >> a[i];
	}

	bool dp[16385] = { false };
	dp[0] = true;
	for (int i = 0;i < n;i++) {
		for (int j = 0;j <= 16384;j++) {
			dp[j^a[i]] |= dp[j];
		}
	}
	int count = 0;
	for (int i = 0;i <= 16384;i++) {
		if (dp[i]) {
			count++;
		}
	}
	cout << count << endl;

	return 0;
}
0