結果

問題 No.2024 Xer
ユーザー ぷらぷら
提出日時 2022-07-29 21:49:54
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 962 bytes
コンパイル時間 2,287 ms
コンパイル使用メモリ 208,612 KB
実行使用メモリ 43,160 KB
最終ジャッジ日時 2023-09-26 20:32:09
合計ジャッジ時間 12,846 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 WA -
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,384 KB
testcase_06 WA -
testcase_07 AC 185 ms
31,644 KB
testcase_08 AC 362 ms
31,528 KB
testcase_09 AC 590 ms
42,960 KB
testcase_10 AC 438 ms
31,320 KB
testcase_11 AC 175 ms
13,912 KB
testcase_12 AC 288 ms
21,944 KB
testcase_13 AC 334 ms
23,488 KB
testcase_14 AC 476 ms
36,868 KB
testcase_15 AC 239 ms
19,676 KB
testcase_16 AC 344 ms
30,936 KB
testcase_17 AC 231 ms
19,096 KB
testcase_18 AC 200 ms
18,064 KB
testcase_19 AC 496 ms
40,572 KB
testcase_20 AC 344 ms
25,820 KB
testcase_21 AC 600 ms
39,364 KB
testcase_22 AC 599 ms
43,160 KB
testcase_23 AC 591 ms
39,356 KB
testcase_24 AC 588 ms
39,328 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 9 ms
4,376 KB
testcase_28 AC 4 ms
4,376 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 16 ms
4,396 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 3 ms
4,376 KB
testcase_40 AC 3 ms
4,380 KB
testcase_41 AC 9 ms
4,376 KB
testcase_42 WA -
testcase_43 AC 10 ms
4,380 KB
testcase_44 AC 12 ms
4,376 KB
testcase_45 AC 484 ms
35,624 KB
testcase_46 AC 116 ms
10,780 KB
testcase_47 AC 366 ms
26,180 KB
testcase_48 AC 2 ms
4,376 KB
testcase_49 AC 2 ms
4,380 KB
testcase_50 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int N,X;
    cin >> N >> X;
    vector<int>A(N);
    for(int i = 0; i < N; i++) {
        cin >> A[i];
    }
    vector<vector<int>>tmp;
    tmp.push_back(A);
    for(int i = 29; i >= 0; i--) {
        vector<vector<int>>nxt;
        for(int j = 0; j < tmp.size(); j++) {
            vector<int>res1,res2;
            for(int k = 0; k < tmp[j].size(); k++) {
                if(1 & (tmp[j][k] >> i)) {
                    res2.push_back(tmp[j][k]);
                }
                else {
                    res1.push_back(tmp[j][k]);
                }
            }
            if(1 & (X >> i)) {
                swap(res1,res2);
            }
            if(res1.size()) {
                nxt.push_back(res1);
            }
            if(res2.size()) {
                nxt.push_back(res2);
            }
        }
        tmp = nxt;
    }
    cout << ((tmp.size() == N)?"Yes":"No") << endl;;
}
0