結果

問題 No.1456 Range Xor
ユーザー hamigakiko0721hamigakiko0721
提出日時 2022-01-31 14:24:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 820 bytes
コンパイル時間 1,419 ms
コンパイル使用メモリ 167,120 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-02 02:09:53
合計ジャッジ時間 25,352 ms
ジャッジサーバーID
(参考情報)
judge12 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 92 ms
4,380 KB
testcase_04 AC 228 ms
4,380 KB
testcase_05 AC 1,278 ms
4,384 KB
testcase_06 AC 102 ms
4,380 KB
testcase_07 AC 1,994 ms
4,380 KB
testcase_08 AC 880 ms
4,376 KB
testcase_09 AC 131 ms
4,380 KB
testcase_10 AC 354 ms
4,384 KB
testcase_11 AC 125 ms
4,380 KB
testcase_12 AC 25 ms
4,376 KB
testcase_13 AC 376 ms
4,380 KB
testcase_14 AC 70 ms
4,376 KB
testcase_15 AC 58 ms
4,380 KB
testcase_16 AC 420 ms
4,380 KB
testcase_17 AC 691 ms
4,380 KB
testcase_18 AC 29 ms
4,380 KB
testcase_19 AC 709 ms
4,376 KB
testcase_20 AC 553 ms
4,380 KB
testcase_21 AC 226 ms
4,380 KB
testcase_22 AC 71 ms
4,380 KB
testcase_23 AC 305 ms
4,380 KB
testcase_24 AC 80 ms
4,380 KB
testcase_25 AC 289 ms
4,380 KB
testcase_26 AC 852 ms
4,380 KB
testcase_27 AC 413 ms
4,376 KB
testcase_28 AC 221 ms
4,380 KB
testcase_29 TLE -
testcase_30 AC 528 ms
4,380 KB
testcase_31 AC 186 ms
4,380 KB
testcase_32 AC 136 ms
4,376 KB
testcase_33 AC 286 ms
4,380 KB
testcase_34 AC 991 ms
4,380 KB
testcase_35 AC 463 ms
4,384 KB
testcase_36 AC 541 ms
4,380 KB
testcase_37 TLE -
testcase_38 AC 89 ms
4,376 KB
testcase_39 AC 168 ms
4,380 KB
testcase_40 AC 1,375 ms
4,376 KB
testcase_41 AC 3 ms
4,380 KB
testcase_42 AC 42 ms
4,376 KB
testcase_43 AC 2 ms
4,380 KB
testcase_44 AC 2 ms
4,376 KB
testcase_45 AC 1 ms
4,376 KB
testcase_46 AC 1 ms
4,376 KB
testcase_47 AC 1 ms
4,376 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;
	//xorの累積和の作成
	vector<int> xor_sum(N+1,0);
	for(int i = 0; i < N; ++i){
		int A; cin >> A;
		xor_sum[i+1] = xor_sum[i] ^ A;
	}
	//全探索で探す
	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