結果
問題 | No.2024 Xer |
ユーザー |
|
提出日時 | 2022-07-29 22:00:20 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 100 ms / 2,000 ms |
コード長 | 448 bytes |
コンパイル時間 | 1,734 ms |
コンパイル使用メモリ | 171,280 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-19 14:43:03 |
合計ジャッジ時間 | 5,013 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 47 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main(){int n, x;cin >> n >> x;vector<int> a(n);for(auto &&v:a)cin >> v;sort(a.begin(), a.end(), [&](int v1, int v2){return (v1 + (v1 ^ x) < v2 + (v2 ^ x));});for(int i = 0; i + 1 < n; i++){if(!(a[i] < (a[i + 1] ^ x) && (a[i] ^ x) < a[i + 1])){cout << "No" << endl;return 0;}}cout << "Yes" << endl;}