結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー karinohitokarinohito
提出日時 2021-04-19 20:20:21
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 509 ms / 5,000 ms
コード長 1,318 bytes
コンパイル時間 989 ms
コンパイル使用メモリ 107,052 KB
実行使用メモリ 23,440 KB
最終ジャッジ日時 2023-09-17 08:22:23
合計ジャッジ時間 4,891 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 509 ms
21,052 KB
testcase_08 AC 359 ms
20,904 KB
testcase_09 AC 246 ms
15,520 KB
testcase_10 AC 296 ms
18,224 KB
testcase_11 AC 389 ms
22,484 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 205 ms
23,316 KB
testcase_15 AC 402 ms
23,440 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 90 ms
7,572 KB
testcase_18 AC 432 ms
20,928 KB
testcase_19 AC 44 ms
5,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//#include <atcoder/all>
#include <iostream>
#include <numeric>
#include <cmath>
#include <limits>
#include <stdio.h>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
//using namespace atcoder;
using ll = long long;
#define all(A) A.begin(),A.end()
using vll = vector<ll>;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using Graph = vector<vector<ll>>;

int main() {
	ll N;
	cin >> N;
	vll A(N);
	rep(i, N)cin >> A[i];

	vector<vector<bool>> DP(N + 1, vector<bool>(32800, false));
	DP[0][0] = true;

	rep(i, N) {
		rep(k, 32800) {
			if (DP[i][k]) {
				DP[i + 1][k] = true;
				DP[i + 1][k ^ A[i]] = true;
			}
		}
	}
	ll an = 0;
	rep(k, 32800) {
		if (DP[N][k])an++;
	}
	cout << an << endl;



}
0