結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー ikdikd
提出日時 2016-10-05 19:53:07
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 405 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 55,680 KB
実行使用メモリ 643,456 KB
最終ジャッジ日時 2024-05-01 12:51:38
合計ジャッジ時間 7,876 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 4 ms
6,940 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 4 ms
6,940 KB
testcase_06 WA -
testcase_07 MLE -
testcase_08 MLE -
testcase_09 AC 553 ms
393,088 KB
testcase_10 AC 617 ms
473,216 KB
testcase_11 MLE -
testcase_12 AC 5 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 MLE -
testcase_15 MLE -
testcase_16 WA -
testcase_17 AC 186 ms
144,512 KB
testcase_18 MLE -
testcase_19 AC 94 ms
72,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int N;
int A[5001];
int dp[5001][(1<<15)+1];

int main() {
	
	cin>> N;
	for(int i=0; i<N; i++) cin>> A[i];
	
	dp[0][0]=1;
	int X=0;
	for(int i=1; i<=N; i++){
		for(int j=0; j<=(1<<15); j++){
			dp[i][j]|=dp[i-1][j xor A[i-1]];
			dp[i][j]|=dp[i-1][j];
		}
	}
	
	int cnt=0;
	for(int j=0; j<=(1<<15); j++){
		cnt+=dp[N][j];
	}
	
	cout<< cnt-1<< endl;
	
	return 0;
}
0