結果

問題 No.2024 Xer
ユーザー 沙耶花沙耶花
提出日時 2022-07-29 22:12:51
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 664 bytes
コンパイル時間 4,558 ms
コンパイル使用メモリ 264,820 KB
実行使用メモリ 6,148 KB
最終ジャッジ日時 2023-09-26 21:16:49
合計ジャッジ時間 8,224 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 84 ms
5,988 KB
testcase_08 AC 86 ms
6,148 KB
testcase_09 AC 107 ms
5,848 KB
testcase_10 AC 87 ms
6,024 KB
testcase_11 AC 33 ms
4,376 KB
testcase_12 AC 56 ms
4,620 KB
testcase_13 AC 61 ms
4,648 KB
testcase_14 AC 98 ms
6,140 KB
testcase_15 AC 44 ms
4,376 KB
testcase_16 AC 67 ms
5,852 KB
testcase_17 AC 40 ms
4,536 KB
testcase_18 AC 39 ms
4,380 KB
testcase_19 AC 98 ms
6,004 KB
testcase_20 AC 59 ms
4,516 KB
testcase_21 AC 103 ms
5,984 KB
testcase_22 AC 102 ms
5,904 KB
testcase_23 AC 103 ms
5,896 KB
testcase_24 AC 102 ms
6,044 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 3 ms
4,380 KB
testcase_27 AC 3 ms
4,376 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 4 ms
4,376 KB
testcase_31 AC 4 ms
4,380 KB
testcase_32 AC 4 ms
4,376 KB
testcase_33 AC 3 ms
4,380 KB
testcase_34 AC 2 ms
4,380 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 3 ms
4,376 KB
testcase_37 AC 4 ms
4,380 KB
testcase_38 AC 4 ms
4,376 KB
testcase_39 AC 2 ms
4,376 KB
testcase_40 AC 2 ms
4,376 KB
testcase_41 AC 3 ms
4,380 KB
testcase_42 AC 4 ms
4,380 KB
testcase_43 AC 3 ms
4,380 KB
testcase_44 AC 3 ms
4,380 KB
testcase_45 AC 84 ms
5,896 KB
testcase_46 AC 20 ms
4,376 KB
testcase_47 AC 62 ms
4,512 KB
testcase_48 AC 2 ms
4,376 KB
testcase_49 AC 1 ms
4,376 KB
testcase_50 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000001


int main() {
    
	int N,X;
	cin>>N>>X;
	
	vector<int> a(N);
	rep(i,N)cin>>a[i];
	
	vector<pair<int,int>> t;
	rep(i,N){
		int cur = 0;
		rep(j,30){
			if((X>>j)&1){
			}
			else{
				cur |= a[i] & (1<<j);
			}
		}
		t.emplace_back(cur,a[i]);
	}
	sort(t.begin(),t.end());
	rep(i,N)a[i] = t[i].second;
	

		
	rep(i,N-1){
		if((a[i]^X)<(a[i+1])){
			if((a[i])<(a[i+1]^X)){
				continue;
			}
		}
		cout<<"No"<<endl;
		return 0;
	}
	
	cout<<"Yes"<<endl;
	
    return 0;
}
0