結果

問題 No.1456 Range Xor
ユーザー UMRgurashiUMRgurashi
提出日時 2022-08-01 17:13:32
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 3,916 bytes
コンパイル時間 4,823 ms
コンパイル使用メモリ 267,636 KB
実行使用メモリ 8,800 KB
最終ジャッジ日時 2023-09-29 13:19:41
合計ジャッジ時間 10,097 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 68 ms
8,764 KB
testcase_04 AC 67 ms
8,800 KB
testcase_05 AC 67 ms
8,536 KB
testcase_06 AC 67 ms
8,644 KB
testcase_07 AC 66 ms
8,580 KB
testcase_08 AC 68 ms
8,608 KB
testcase_09 AC 68 ms
8,540 KB
testcase_10 AC 69 ms
8,680 KB
testcase_11 AC 10 ms
4,380 KB
testcase_12 AC 4 ms
4,376 KB
testcase_13 AC 18 ms
5,028 KB
testcase_14 AC 18 ms
4,832 KB
testcase_15 AC 53 ms
7,484 KB
testcase_16 AC 48 ms
7,480 KB
testcase_17 AC 25 ms
5,448 KB
testcase_18 AC 17 ms
4,796 KB
testcase_19 AC 38 ms
6,512 KB
testcase_20 AC 48 ms
7,308 KB
testcase_21 AC 36 ms
6,196 KB
testcase_22 AC 38 ms
6,564 KB
testcase_23 AC 20 ms
5,048 KB
testcase_24 AC 9 ms
4,376 KB
testcase_25 AC 15 ms
4,664 KB
testcase_26 AC 28 ms
5,776 KB
testcase_27 AC 43 ms
6,872 KB
testcase_28 AC 13 ms
4,564 KB
testcase_29 AC 58 ms
7,836 KB
testcase_30 AC 63 ms
8,356 KB
testcase_31 AC 12 ms
4,516 KB
testcase_32 AC 10 ms
4,428 KB
testcase_33 AC 23 ms
5,168 KB
testcase_34 AC 62 ms
8,148 KB
testcase_35 AC 29 ms
5,876 KB
testcase_36 AC 66 ms
8,356 KB
testcase_37 AC 56 ms
7,832 KB
testcase_38 AC 9 ms
4,376 KB
testcase_39 AC 46 ms
7,032 KB
testcase_40 AC 45 ms
7,044 KB
testcase_41 AC 2 ms
4,376 KB
testcase_42 AC 6 ms
4,380 KB
testcase_43 WA -
testcase_44 AC 1 ms
4,376 KB
testcase_45 AC 1 ms
4,380 KB
testcase_46 AC 1 ms
4,380 KB
testcase_47 WA -
testcase_48 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <cstdlib>
#include <chrono>
//using namespace chrono;
#include <atcoder/all>
using namespace atcoder;


#define int long long
#define double long double
#define stoi stoll
#define endl "\n"
using std::abs;

using namespace std;


//constexpr int MOD = 1000000007;
constexpr int MOD = 998244353;
//using mint = modint1000000007;
using mint = modint998244353;

constexpr double PI = 3.14159265358979323846;
const  int INF = 1LL << 62;
const int dx[8] = { 1, 0, -1, 0 ,1,1,-1,-1};
const int dy[8] = { 0, 1, 0, -1,1,-1,1,-1 };


#define rep(i,n) for(int i=0;i<n;++i)
#define REP(i,n) for(int i=1;i<=n;i++)
#define sREP(i,n) for(int i=1;i*i<=n;++i)
#define krep(i,k,n) for(int i=(k);i<n+k;i++)
#define Krep(i,k,n) for(int i=(k);i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define Rrep(i,n) for(int i=n;i>0;i--)
#define frep(i,n) for(auto &x:n)
#define LAST(x) x[x.size()-1]
#define ALL(x) (x).begin(),(x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x)
#define RUD(a,b) (((a)+(b)-1)/(b))
#define sum1_n(n) ((n)*(n+1)/2)
#define SUM1n2(n) (n*(2*n+1)*(n+1))/6
#define SUMkn(k,n) (SUM1n(n)-SUM1n(k-1))
#define SZ(x) ((int)(x).size())
#define PB push_back
#define Fi first
#define Se second

template<class... T>
constexpr auto min(T... a) {
	return min(initializer_list<common_type_t<T...>>{a...});
}

template<class... T>
constexpr auto max(T... a) {
	return max(initializer_list<common_type_t<T...>>{a...});
}

template<class... T>
void in(T&... a) {
	(cin >> ... >> a);
}

template <class T>
using v = vector<T>;
template <class T>
using vv = vector<v<T>>;
template <class T>
using vvv = vector<vv<T>>;

using pint = pair<int, int>;
using tint = tuple<int, int, int>;

double LOG(int a, int b) {
	return log(b) / log(a);
}
double DISTANCE(int x1, int y1, int x2, int y2) {
	return sqrt(abs(x1 - x2) * abs(x1 - x2) + abs(y1 - y2) * abs(y1 - y2));
}

inline bool BETWEEN(int x, int min, int max) {
	if (min <= x && x <= max)
		return true;
	else
		return false;
}
inline bool between(int x, int min, int max) {
	if (min < x && x < max) return true;
	else return false;
}
inline bool BETWEEN2(int i, int j, int H, int W) {
	if (BETWEEN(i, 0, H - 1) && BETWEEN(j, 0, W - 1)) return true;
	else return false;
}

template<class T>
inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T>
inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}

inline bool bit(int x, int i) {
	return x >> i & 1;
}

int ini() { int x; cin >> x; return x; }
string ins() { string x; cin >> x; return x; }

void  yn(bool x) {
	if (x) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}
void  YN(bool x) {
	if (x) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
}

int ipow(int x, int n) {
	int ans = 1;
	while (n > 0) {
		if (n & 1) ans *= x;
		x *= x;
		n >>= 1;
	}
	return ans;
}

template <typename T>
vector<T> compress(vector<T>& X) {
	vector<T> vals = X;
	sort(ALL(vals));
	vals.erase(unique(ALL(vals)), vals.end());
	rep(i, SZ(X))
		X[i] = lower_bound(ALL(vals), X[i]) - vals.begin();
	return vals;
}

vector<pair<char, int>> run_length(string x) {
	vector<pair<char, int>> ans;

	char ch = x[0];
	int cou = 1;
	REP(i, SZ(x)) {
		if (x[i] == x[i - 1]) {
			cou++;
		}
		else {
			ans.push_back({ ch,cou });
			ch = x[i];
			cou = 1;
		}
	}
	return ans;
}



void solve() {
	//xor(i~j) = xor(1~i) xor xor(1~j) = K
	//xor(1~i) xor K = xor(1~j)
	int N, K;
	in(N, K);
	v<int> a(N);
	set<int> se;
	rep(i, N) cin >> a[i];
	int now = K;
	rep(i, N) {
		now ^= a[i];
		se.insert(now);
	}
	now = 0;
	bool ans = false;
	rep(i, N) {
		now ^= a[i];
		if (se.count(now))ans = true;
	}
	yn(ans);

}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout << fixed << setprecision(10);
	//cout << setfill('0') << right << setw(4)<<
	solve();
}
0