結果

問題 No.1456 Range Xor
ユーザー hamigakiko0721hamigakiko0721
提出日時 2022-01-31 14:22:09
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 864 bytes
コンパイル時間 1,663 ms
コンパイル使用メモリ 166,220 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-02 02:09:28
合計ジャッジ時間 20,779 ms
ジャッジサーバーID
(参考情報)
judge11 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 94 ms
4,380 KB
testcase_04 AC 229 ms
4,376 KB
testcase_05 AC 1,281 ms
4,376 KB
testcase_06 AC 104 ms
4,376 KB
testcase_07 TLE -
testcase_08 AC 889 ms
4,376 KB
testcase_09 AC 131 ms
4,376 KB
testcase_10 AC 357 ms
4,384 KB
testcase_11 AC 125 ms
4,384 KB
testcase_12 AC 26 ms
4,376 KB
testcase_13 AC 379 ms
4,380 KB
testcase_14 AC 72 ms
4,384 KB
testcase_15 AC 59 ms
4,504 KB
testcase_16 AC 424 ms
4,380 KB
testcase_17 AC 692 ms
4,380 KB
testcase_18 AC 29 ms
4,380 KB
testcase_19 AC 717 ms
4,376 KB
testcase_20 AC 558 ms
4,384 KB
testcase_21 AC 229 ms
4,376 KB
testcase_22 AC 72 ms
4,376 KB
testcase_23 AC 307 ms
4,380 KB
testcase_24 AC 81 ms
4,380 KB
testcase_25 AC 294 ms
4,380 KB
testcase_26 AC 864 ms
4,384 KB
testcase_27 AC 417 ms
4,380 KB
testcase_28 AC 223 ms
4,380 KB
testcase_29 TLE -
testcase_30 AC 535 ms
4,376 KB
testcase_31 AC 186 ms
4,376 KB
testcase_32 AC 136 ms
4,380 KB
testcase_33 AC 294 ms
4,380 KB
testcase_34 AC 1,174 ms
4,376 KB
testcase_35 AC 819 ms
4,380 KB
testcase_36 AC 827 ms
4,376 KB
testcase_37 TLE -
testcase_38 AC 95 ms
4,380 KB
testcase_39 AC 190 ms
4,384 KB
testcase_40 AC 1,898 ms
4,380 KB
testcase_41 AC 3 ms
4,376 KB
testcase_42 AC 45 ms
4,380 KB
testcase_43 AC 2 ms
4,380 KB
testcase_44 AC 1 ms
4,380 KB
testcase_45 AC 2 ms
4,376 KB
testcase_46 AC 2 ms
4,376 KB
testcase_47 AC 2 ms
4,380 KB
testcase_48 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<iostream>
using namespace std;
using LL = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
const int INF = 1 << 29;
const long long LINF = 1LL << 60;
#define all(x) (x).begin(), (x).end()
#define rep(i,n) for(int i = 0; i < (n); ++i)
template<class T>void chmin(T&a, T b){if(a > b) a = b;}
template<class T>void chmax(T&a, T b){if(a < b) a = b;}


int main(){
	//データの入力
	int N, K; cin >> N >> K;
	vector<int> A(N);
	for(int i = 0; i < N; ++i) cin >> A[i];
	//xorの累積和の作成
	vector<int> xor_sum(N+1,0);
	for(int i = 0; i < N; ++i){
		xor_sum[i+1] = xor_sum[i] ^ A[i];
	}
	//全探索で探す
	for(int i = 1; i <= N; ++i){
		for(int j = 0; j < i; ++j){
			int tmp = xor_sum[i] ^ xor_sum[j];
			if(tmp == K){
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;
}

0