結果
問題 | No.2024 Xer |
ユーザー | ruthen |
提出日時 | 2022-07-29 23:25:37 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,630 bytes |
コンパイル時間 | 4,954 ms |
コンパイル使用メモリ | 205,408 KB |
実行使用メモリ | 15,808 KB |
最終ジャッジ日時 | 2023-09-26 23:12:39 |
合計ジャッジ時間 | 6,247 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,380 KB |
testcase_01 | AC | 2 ms
4,384 KB |
testcase_02 | AC | 2 ms
4,376 KB |
testcase_03 | AC | 2 ms
4,380 KB |
testcase_04 | AC | 1 ms
4,380 KB |
testcase_05 | AC | 2 ms
4,380 KB |
testcase_06 | WA | - |
testcase_07 | AC | 88 ms
15,808 KB |
testcase_08 | AC | 142 ms
8,060 KB |
testcase_09 | AC | 41 ms
4,380 KB |
testcase_10 | AC | 173 ms
6,448 KB |
testcase_11 | AC | 67 ms
4,380 KB |
testcase_12 | AC | 111 ms
5,252 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | AC | 16 ms
4,376 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | AC | 24 ms
4,380 KB |
testcase_21 | AC | 41 ms
4,380 KB |
testcase_22 | AC | 41 ms
4,376 KB |
testcase_23 | AC | 41 ms
4,380 KB |
testcase_24 | AC | 41 ms
4,376 KB |
testcase_25 | AC | 3 ms
4,376 KB |
testcase_26 | AC | 6 ms
4,380 KB |
testcase_27 | WA | - |
testcase_28 | AC | 3 ms
4,380 KB |
testcase_29 | AC | 3 ms
4,376 KB |
testcase_30 | AC | 5 ms
4,380 KB |
testcase_31 | AC | 7 ms
4,376 KB |
testcase_32 | WA | - |
testcase_33 | AC | 5 ms
4,376 KB |
testcase_34 | AC | 3 ms
4,380 KB |
testcase_35 | AC | 2 ms
4,376 KB |
testcase_36 | AC | 5 ms
4,380 KB |
testcase_37 | AC | 6 ms
4,380 KB |
testcase_38 | AC | 8 ms
4,376 KB |
testcase_39 | AC | 2 ms
4,376 KB |
testcase_40 | AC | 3 ms
4,380 KB |
testcase_41 | WA | - |
testcase_42 | AC | 5 ms
4,380 KB |
testcase_43 | WA | - |
testcase_44 | AC | 7 ms
4,376 KB |
testcase_45 | AC | 33 ms
4,376 KB |
testcase_46 | AC | 8 ms
4,388 KB |
testcase_47 | AC | 25 ms
4,388 KB |
testcase_48 | AC | 1 ms
4,380 KB |
testcase_49 | AC | 1 ms
4,376 KB |
testcase_50 | AC | 1 ms
4,380 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; #ifdef _RUTHEN #include "debug.hpp" #else #define show(...) true #endif using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) template <class T> using V = vector<T>; int main() { ios::sync_with_stdio(false); cin.tie(0); int N, X; cin >> N >> X; V<int> A(N); for (auto &a : A) cin >> a; sort(A.begin(), A.end()); A.erase(unique(A.begin(), A.end()), A.end()); if (A.size() != N) { cout << "No" << '\n'; return 0; } auto rec = [&X](auto f, V<int> &A, int b) -> bool { show(A, b); if (b < 0) return true; if (X >> b & 1) { V<int> L, R; for (auto a : A) { if (a >> b & 1) { R.push_back(a); } else { L.push_back(a); } } if (abs((int)L.size() - (int)R.size()) > 1) { return false; } bool res = true; if (L.size() > 0) res &= f(f, L, b - 1); if (R.size() > 0) res &= f(f, R, b - 1); return res; } else { V<int> L, R; for (auto a : A) { if (a >> b & 1) { R.push_back(a); } else { L.push_back(a); } } bool res = true; if (L.size() > 0) res &= f(f, L, b - 1); if (R.size() > 0) res &= f(f, R, b - 1); return res; } }; cout << (rec(rec, A, 30) ? "Yes" : "No") << '\n'; return 0; }