結果
| 問題 |
No.2024 Xer
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-07-30 00:42:28 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 61 ms / 2,000 ms |
| コード長 | 1,966 bytes |
| コンパイル時間 | 2,091 ms |
| コンパイル使用メモリ | 205,712 KB |
| 最終ジャッジ日時 | 2025-01-30 16:25:06 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 47 |
ソースコード
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vvvvll = vector<vvvll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using vvvvb = vector<vvvb>;
using vd = vector<double>;
using vvd = vector<vd>;
using vvvd = vector<vvd>;
#define all(A) A.begin(),A.end()
#define ALL(A) A.begin(),A.end()
#define rep(i, n) for (ll i = 0; i < (ll) (n); i++)
using pqr = priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>>;
template<class T>
bool chmax(T& p, T q, bool C = 1) {
if (C == 0 && p == q) {
return 1;
}
if (p < q) {
p = q;
return 1;
}
else {
return 0;
}
}
template<class T>
bool chmin(T& p, T q, bool C = 1) {
if (C == 0 && p == q) {
return 1;
}
if (p > q) {
p = q;
return 1;
}
else {
return 0;
}
}
ll gcd(ll(a), ll(b)) {
if (b == 0)return a;
ll c = a;
while (a % b != 0) {
c = a % b;
a = b;
b = c;
}
return b;
}
vector<vector<pair<ll,pair<ll,ll>>>> G;
vll D;
vector<bool> seen;
void dfs(ll n){
seen[n]=1;
for(auto v:G[n]){
if(seen[v.first])continue;
if(v.second.second==1){
D[v.second.first]=1;
}
else D[v.second.first]=0;
dfs(v.first);
}
return;
}
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll N,X;
cin>>N>>X;
vector<pair<ll,ll>>P(N);
rep(i,N){
ll A;
cin>>A;
P[i]={min(A,(A^X)),A};
}
sort(all(P));
rep(i,N-1){
if(P[i].second>=(P[i+1].second^X)){
cout<<"No"<<endl;
return 0;
}
if((P[i].second^X)>=(P[i+1].second)){
cout<<"No"<<endl;
return 0;
}
}
cout<<"Yes"<<endl;
}