結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー snrnsidysnrnsidy
提出日時 2021-05-27 02:02:47
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 587 bytes
コンパイル時間 2,551 ms
コンパイル使用メモリ 207,332 KB
実行使用メモリ 163,628 KB
最終ジャッジ日時 2024-04-23 19:00:02
合計ジャッジ時間 5,492 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
163,420 KB
testcase_01 AC 42 ms
163,552 KB
testcase_02 AC 41 ms
163,404 KB
testcase_03 AC 42 ms
163,600 KB
testcase_04 AC 41 ms
163,404 KB
testcase_05 AC 43 ms
163,548 KB
testcase_06 AC 40 ms
163,572 KB
testcase_07 WA -
testcase_08 AC 185 ms
163,516 KB
testcase_09 AC 190 ms
163,592 KB
testcase_10 AC 161 ms
163,372 KB
testcase_11 AC 199 ms
163,372 KB
testcase_12 WA -
testcase_13 AC 42 ms
163,448 KB
testcase_14 AC 168 ms
163,628 KB
testcase_15 AC 204 ms
163,548 KB
testcase_16 AC 43 ms
163,452 KB
testcase_17 AC 77 ms
163,332 KB
testcase_18 WA -
testcase_19 AC 59 ms
163,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("O3")
#include <bits/stdc++.h>
 
using namespace std;

bool dp[5001][32758];

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n,t;
	vector <int> v;

	cin >> n;

	for(int i=0;i<n;i++)
	{
		cin >> t;
		v.push_back(t);
	}

	memset(dp,false,sizeof(dp));

	dp[0][0] = true;

	for(int i=0;i<n;i++)
	{
		for(int j=0;j<32758;j++)
		{
			if(dp[i][j]==false)
			{
				continue;
			}
			dp[i+1][j] = true;
			dp[i+1][j^v[i]] = true;
		}
	}

	int res = 0;

	for(int i=0;i<32758;i++)
	{
		if(dp[n][i])
		{
			res++;
		}
	}

	cout << res << '\n';
	
	return 0;
}
0