結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー Tawara
提出日時 2015-08-28 11:19:19
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
MLE  
実行時間 -
コード長 697 bytes
コンパイル時間 632 ms
コンパイル使用メモリ 77,528 KB
実行使用メモリ 663,424 KB
最終ジャッジ日時 2024-07-18 15:04:33
合計ジャッジ時間 7,416 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12 MLE * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cmath>
#include <string>

using namespace std;

typedef long long LL;

#define range(i,a,b) for(int i=(a); i < (b); i++)
#define rep(i,n) range(i,0,n)

#define MAX_INT 2147483647
int main(){
	int N, M = 1<<15, ans = 0;
	vector < vector <int> > dp;   
	cin >> N;
	LL A[N];
	dp = vector <vector <int> >(N, vector <int> (M, 0)); 
	rep(i,N) cin >> A[i];
	dp[0][0] = 1;
	dp[0][A[0]] = 1;
	rep(i,N-1){
		rep(j,M){
			if(dp[i][j]){
				dp[i+1][j] = 1;
				dp[i+1][j^A[i+1]] = 1;
			}
		}
	}
	rep(i,M) ans += dp[N-1][i];
	cout << ans << endl;
	return 0;
}
0