結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー TawaraTawara
提出日時 2015-08-28 11:19:19
言語 C++11
(gcc 11.4.0)
結果
MLE  
実行時間 -
コード長 697 bytes
コンパイル時間 1,013 ms
コンパイル使用メモリ 76,436 KB
実行使用メモリ 663,584 KB
最終ジャッジ日時 2023-09-25 19:01:27
合計ジャッジ時間 8,507 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 4 ms
4,844 KB
testcase_03 AC 3 ms
4,704 KB
testcase_04 AC 3 ms
4,376 KB
testcase_05 AC 4 ms
5,008 KB
testcase_06 AC 3 ms
4,380 KB
testcase_07 MLE -
testcase_08 MLE -
testcase_09 AC 470 ms
405,172 KB
testcase_10 AC 570 ms
487,892 KB
testcase_11 MLE -
testcase_12 AC 4 ms
5,208 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 MLE -
testcase_15 MLE -
testcase_16 AC 3 ms
4,624 KB
testcase_17 AC 162 ms
148,780 KB
testcase_18 MLE -
testcase_19 AC 81 ms
74,272 KB
権限があれば一括ダウンロードができます

ソースコード

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