結果

問題 No.1456 Range Xor
ユーザー tomoT222tomoT222
提出日時 2021-03-31 21:03:46
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 2,552 bytes
コンパイル時間 892 ms
コンパイル使用メモリ 102,532 KB
実行使用メモリ 15,432 KB
最終ジャッジ日時 2023-08-21 19:07:06
合計ジャッジ時間 4,411 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 61 ms
11,472 KB
testcase_04 AC 58 ms
11,212 KB
testcase_05 AC 67 ms
11,820 KB
testcase_06 AC 62 ms
11,156 KB
testcase_07 AC 92 ms
14,656 KB
testcase_08 AC 66 ms
11,948 KB
testcase_09 AC 60 ms
11,424 KB
testcase_10 AC 55 ms
10,948 KB
testcase_11 AC 15 ms
5,768 KB
testcase_12 AC 7 ms
4,380 KB
testcase_13 AC 28 ms
7,616 KB
testcase_14 AC 20 ms
6,144 KB
testcase_15 AC 48 ms
9,960 KB
testcase_16 AC 41 ms
9,048 KB
testcase_17 AC 39 ms
9,260 KB
testcase_18 AC 16 ms
5,400 KB
testcase_19 AC 35 ms
8,104 KB
testcase_20 AC 43 ms
9,176 KB
testcase_21 AC 32 ms
7,852 KB
testcase_22 AC 34 ms
8,116 KB
testcase_23 AC 23 ms
6,520 KB
testcase_24 AC 13 ms
5,400 KB
testcase_25 AC 25 ms
7,116 KB
testcase_26 AC 48 ms
9,576 KB
testcase_27 AC 38 ms
8,304 KB
testcase_28 AC 21 ms
6,536 KB
testcase_29 AC 111 ms
15,432 KB
testcase_30 AC 58 ms
10,636 KB
testcase_31 AC 20 ms
6,260 KB
testcase_32 AC 17 ms
5,680 KB
testcase_33 AC 29 ms
7,204 KB
testcase_34 AC 58 ms
10,896 KB
testcase_35 AC 28 ms
7,248 KB
testcase_36 AC 58 ms
11,016 KB
testcase_37 AC 97 ms
15,040 KB
testcase_38 AC 14 ms
5,712 KB
testcase_39 AC 40 ms
8,780 KB
testcase_40 AC 62 ms
11,800 KB
testcase_41 AC 2 ms
4,376 KB
testcase_42 AC 9 ms
4,664 KB
testcase_43 AC 1 ms
4,380 KB
testcase_44 AC 2 ms
4,380 KB
testcase_45 AC 1 ms
4,380 KB
testcase_46 AC 1 ms
4,376 KB
testcase_47 AC 2 ms
4,376 KB
testcase_48 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<algorithm>    
#include<cmath>
#include<ctime>
#include<map>
#include<vector>
#include<math.h>
#include<stdio.h>
#include<stack>
#include<queue>
#include<tuple>
#include<cassert>
#include<set>
#include<bitset>
#include<functional>
#include <fstream>
//#include<bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define rep(i, x) for(ll i = 0; i < x; i++)
#define rep2(i, x) for(ll i = 1; i <= x; i++)
#define all(a) (a).begin(),(a).end()
#define puts(x) cout << (x) << "\n"
using ll = long long;
using ld = long double;
using namespace std;
const ll INF = 1000000000000000000;
const int intINF = 1000000000;
const ll mod = 1000000007;
const ll MOD = 998244353;
const ld pi = 3.141592653589793238;
//const ld EPS = 1e-9;

bool isprime(int p) {
	if (p == 1) return false;
	for (int i = 2; i < p; i++) {
		if (p % i == 0) return false;
	}
	return true;
}
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (a % b == 0)return b;
	return gcd(b, a % b);
}
// 返り値: a と b の最大公約数
// ax + by = gcd(a, b) を満たす (x, y) が格納される
//main関数内に extGCD(a, b, x, y); でx, yに解が格納
ll extGCD(ll a, ll b, ll& x, ll& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	ll d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}
ll keta(ll n) {
	ll res = 0;
	while (n >= 1) {
		res += n % 10; n /= 10;
	}
	return res;
}
ll modpow(ll x, ll y) {
	ll res = 1;
	while (y) {
		if (y % 2) { res *= x; res %= mod; }
		x = x * x % mod; y /= 2;
	}
	return res;
}
ll nCk(ll n, ll k) {
	ll a = 1, b = 1;
	for (int h = n - k + 1; h <= n; h++) { a *= h; a %= mod; }
	for (int h = 1; h <= k; h++) { b *= h; b %= mod; }
	return a * modpow(b, mod - 2) % mod;
}
//printf("%.10f\n", n);
typedef pair <ll, ll> P;
typedef pair <ld, ll> pp;
ll dx[4] = { 1, 0, -1, 0 }, dy[4] = { 0, 1, 0, -1 };
struct edge { ll to, cost; };
struct status {
	ll ima;
	ll cost;

	bool operator<(const status& rhs) const { return cost < rhs.cost; };
	bool operator>(const status& rhs) const { return cost > rhs.cost; };
};



signed main() {
	ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	//cout << fixed << setprecision(15);

	//input
	ll n, k; cin >> n >> k;
	vector<ll>a(n + 1), rui(n + 1);
	map<ll, ll> m;
	rep2(i, n) { cin >> a[i]; rui[i] = rui[i - 1] ^ a[i]; m[rui[i]] = i; }
	rep(i, n + 1) {
		ll cnt = rui[i] ^ k;
		if (m[cnt] > i) { cout << "Yes\n"; return 0; }
	}
	cout << "No\n";
	return 0;
}
0