結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー 🍡yurahuna🍡yurahuna
提出日時 2016-02-26 17:15:52
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,056 bytes
コンパイル時間 671 ms
コンパイル使用メモリ 74,260 KB
実行使用メモリ 83,688 KB
最終ジャッジ日時 2023-10-23 20:19:18
合計ジャッジ時間 2,930 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 WA -
testcase_08 AC 116 ms
74,876 KB
testcase_09 AC 80 ms
53,488 KB
testcase_10 AC 96 ms
63,728 KB
testcase_11 AC 126 ms
82,164 KB
testcase_12 WA -
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 135 ms
83,676 KB
testcase_15 AC 130 ms
83,688 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 30 ms
22,760 KB
testcase_18 WA -
testcase_19 AC 15 ms
12,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <complex>
#include <queue>
#include <map>
#include <string>
using namespace std;

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define pb push_back
#define ALL(a) (a).begin(),(a).end()

#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b)) < EPS)

#define PI 3.1415926535

typedef long long ll;
typedef pair<int, int> P;
//typedef complex<double> C;

const int MAX_N = 5000;
const int MAX_A = 1<<15 - 1;

int N;
int A[MAX_N];
bool dp[MAX_N + 1][MAX_A + 1];

void input() {
	cin >> N;
	REP(i, N) cin >> A[i];
}

void solve() {
	REP(i, N) {
		REP(j, MAX_A + 1) {
			dp[i][j] = false;
		}
	}
	dp[0][0] = true;

	REP(i, N) {
		REP(j, MAX_A + 1) {
			if (dp[i][j]) {
				dp[i+1][j ^ A[i]] = true;
				dp[i+1][j] = true;
			}
		}
	}
	int cnt = 0;
	REP(j, MAX_A + 1) {
		if (dp[N][j]) {
			cnt++;
		}
	}
	cout << cnt << endl;
}

int main() {
	input();
	solve();
}
0