結果

問題 No.2672 Subset Xor Sum
ユーザー GOTKAKOGOTKAKO
提出日時 2024-03-15 21:36:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 657 bytes
コンパイル時間 2,002 ms
コンパイル使用メモリ 204,588 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-03-15 21:36:51
合計ジャッジ時間 7,577 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 2 ms
6,676 KB
testcase_24 AC 2 ms
6,676 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 AC 2 ms
6,676 KB
testcase_30 AC 38 ms
6,676 KB
testcase_31 AC 17 ms
6,676 KB
testcase_32 AC 14 ms
6,676 KB
testcase_33 AC 28 ms
6,676 KB
testcase_34 AC 37 ms
6,676 KB
testcase_35 AC 31 ms
6,676 KB
testcase_36 AC 35 ms
6,676 KB
testcase_37 AC 18 ms
6,676 KB
testcase_38 AC 42 ms
6,676 KB
testcase_39 AC 9 ms
6,676 KB
testcase_40 AC 24 ms
6,676 KB
testcase_41 AC 35 ms
6,676 KB
testcase_42 AC 27 ms
6,676 KB
testcase_43 AC 42 ms
6,676 KB
testcase_44 AC 27 ms
6,676 KB
testcase_45 AC 2 ms
6,676 KB
testcase_46 RE -
testcase_47 AC 2 ms
6,676 KB
testcase_48 AC 2 ms
6,676 KB
testcase_49 AC 2 ms
6,676 KB
testcase_50 RE -
testcase_51 RE -
testcase_52 RE -
testcase_53 RE -
testcase_54 RE -
testcase_55 AC 2 ms
6,676 KB
testcase_56 AC 40 ms
6,676 KB
testcase_57 AC 12 ms
6,676 KB
testcase_58 AC 2 ms
6,676 KB
testcase_59 AC 2 ms
6,676 KB
testcase_60 AC 2 ms
6,676 KB
testcase_61 RE -
testcase_62 RE -
testcase_63 RE -
testcase_64 RE -
testcase_65 AC 2 ms
6,676 KB
testcase_66 AC 1 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int N; cin >> N;
    int Xor = 0;
    vector<int> A(N);
    for(auto &a : A) cin >> a,Xor ^= a;
    if(Xor){cout << "No" << endl; return 0;}
    if(N >= 5001){cout << "Yes" << endl; return 0;}

    bool yes = false;
    bitset<5001> ok;
    for(int i=0; i<N; i++){
        int a = A.at(i);
        if(ok.test(a) && i != N-1) yes = true;


        bitset<5001> ok2;
        for(int k=0; k<=5000; k++) if(ok.test(k)) ok2.set(k^a);
        ok |= ok2; ok.set(a);
    }
    if(yes) cout << "Yes" << endl;
    else cout << "No" << endl;
}
0