結果
問題 |
No.2024 Xer
|
ユーザー |
|
提出日時 | 2022-07-29 23:38:52 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 45 ms / 2,000 ms |
コード長 | 887 bytes |
コンパイル時間 | 2,147 ms |
コンパイル使用メモリ | 198,600 KB |
最終ジャッジ日時 | 2025-01-30 15:50:39 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 47 |
ソースコード
#include <bits/stdc++.h> // debug #ifdef LOCAL #include <debug_print.hpp> #define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__) #else #define debug(...) (static_cast<void>(0)) #endif // #include "atcoder/all" using namespace std; using ll = long long; using ld = long double; void solve() { int n, x; cin >> n >> x; vector<int> v(n); for (int i = 0; i < n; i++) { cin >> v[i]; } sort(v.begin(), v.end(), [x](int a, int b) { return min(a, a ^ x) < min(b, b ^ x); }); debug(v); bool ok = true; for (int i = 0; i < n - 1; i++) { ok &= v[i] < (v[i + 1] ^ x); ok &= (v[i] ^ x) < v[i + 1]; } cout << (ok ? "Yes" : "No") << endl; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t = 1; // cin >> t; while (t--) { solve(); } return 0; }