結果
| 問題 |
No.1456 Range Xor
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-31 14:24:32 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 820 bytes |
| コンパイル時間 | 1,683 ms |
| コンパイル使用メモリ | 167,704 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-06-11 08:48:51 |
| 合計ジャッジ時間 | 8,313 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 TLE * 2 -- * 19 |
ソースコード
#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;
}