結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー syake_tasyake_ta
提出日時 2018-08-26 18:38:40
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 197 ms / 5,000 ms
コード長 1,210 bytes
コンパイル時間 651 ms
コンパイル使用メモリ 84,528 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-13 19:21:30
合計ジャッジ時間 3,054 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,384 KB
testcase_07 AC 171 ms
4,376 KB
testcase_08 AC 174 ms
4,376 KB
testcase_09 AC 121 ms
4,380 KB
testcase_10 AC 143 ms
4,376 KB
testcase_11 AC 189 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 182 ms
4,380 KB
testcase_15 AC 197 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 44 ms
4,376 KB
testcase_18 AC 168 ms
4,376 KB
testcase_19 AC 23 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
#include<functional>
#include<iomanip>
#include<queue>
#include<cassert>
#include<tuple>
#include<set>
#include<map>
#include<list>
#include<bitset>
#include<utility>
#include<numeric>

#define PB push_back
#define all(a)  (a).begin(),(a).end()
#define ALL(v) begin(v), end(v)
#define DWN(a)  (a).begin(),(a).end(), greater<int>()
#define rep(i, m) for (int i = 0; i < m; i++)
#define REP(i, n, m) for (int i = n; i < m; i++)
#define V vector<int>
#define VV vector<V>
#define VVV vector<VV>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
const int inf = (int)1e9;
const ll INF = (ll)1e18;
const ll MOD{ (ll)1e9 + 7 };
const long double EPS = 1e-10;

bool dp[1 << 15] = {};

int main() {
	int n;
	cin >> n;

	dp[0] = true;

	for(int i = 0; i < n; i++) {
		int tmp;
		cin >> tmp;
		for(int j = 0; j < (1 << 15); j++) {
			if (dp[j]) {
				dp[tmp ^ j] = true;
			}
		}
	}

	int cnt = 0;
	for(int i = 0; i < (1 << 15); i++) {
		if (dp[i]) {
			cnt++;
		}
	}

	cout << cnt << endl;
	return 0;
}
0