結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー kyawashellkyawashell
提出日時 2018-03-29 10:33:53
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 797 bytes
コンパイル時間 1,847 ms
コンパイル使用メモリ 198,332 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-08 03:32:08
合計ジャッジ時間 3,700 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 WA -
testcase_08 AC 114 ms
4,380 KB
testcase_09 AC 78 ms
4,376 KB
testcase_10 AC 94 ms
4,380 KB
testcase_11 AC 123 ms
4,380 KB
testcase_12 WA -
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 127 ms
4,376 KB
testcase_15 AC 127 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 29 ms
4,384 KB
testcase_18 WA -
testcase_19 AC 15 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(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 mp make_pair
#define fi first
#define sc second
ll n;
ll a[10000];
bool dp[2][(1 << 15)];
int main(){
	cin >> n;
	REP(i,n) {
		cin >> a[i];
	}

	dp[0][0] = true;

	FOR(i,1,n + 1) {
		REP(j,(1 << 14) + 1) {
			dp[1][j] = (dp[0][j] || dp[0][j ^ a[i - 1]]);
		}
		REP(j,(1 << 14) + 1) {
			dp[0][j] = dp[1][j];
		}
	}
	
	ll ans = 0;
	REP(j,(1 << 14) + 1) {
		ans += dp[1][j];
	}
	cout << ans << endl;

	return 0;
}
0