結果

問題 No.2672 Subset Xor Sum
ユーザー Today03Today03
提出日時 2024-03-16 11:22:31
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,164 bytes
コンパイル時間 2,328 ms
コンパイル使用メモリ 202,540 KB
実行使用メモリ 13,480 KB
最終ジャッジ日時 2024-03-16 11:22:43
合計ジャッジ時間 12,829 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 108 ms
6,676 KB
testcase_31 AC 45 ms
6,676 KB
testcase_32 AC 38 ms
6,676 KB
testcase_33 AC 78 ms
6,676 KB
testcase_34 AC 106 ms
6,676 KB
testcase_35 AC 88 ms
6,676 KB
testcase_36 AC 102 ms
6,676 KB
testcase_37 AC 52 ms
6,676 KB
testcase_38 AC 117 ms
6,676 KB
testcase_39 AC 22 ms
6,676 KB
testcase_40 AC 69 ms
6,676 KB
testcase_41 AC 108 ms
6,676 KB
testcase_42 AC 82 ms
6,676 KB
testcase_43 AC 120 ms
6,676 KB
testcase_44 AC 76 ms
6,676 KB
testcase_45 AC 3 ms
6,676 KB
testcase_46 OLE -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
testcase_60 -- -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
testcase_64 -- -
testcase_65 -- -
testcase_66 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#ifdef LOCAL
#include "./debug.cpp"
#else
#define debug(...)
#define print_line
#endif
using namespace std;
using ll = long long;

int N, A[5 << 17];
bool dp[2][1 << 13][2];

int main() {
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }

    int xors = 0;
    for (int i = 0; i < N; i++) {
        xors ^= A[i];
    }

    if (xors != 0) {
        cout << "No" << endl;
        return 0;
    }

    if (N > 5000) {
        cout << "Yes" << endl;
        return 0;
    }

    int mx = 1 << 13;
    dp[0][A[0]][1] = true;
    for (int i = 0; i < N - 1; i++) {
        for (int j = 0; j < mx; j++) {
            for (int k = 0; k < 2; k++) {
                if (dp[i % 2][j][k]) {
                    cout << i << ' ' << j << ' ' << k << endl;
                    dp[1 - i % 2][j][0] = true;
                    dp[1 - i % 2][j ^ A[i + 1]][k] = true;
                }
            }
        }
        for (int j = 0; j < mx; j++) {
            dp[i % 2][j][0] = dp[i % 2][j][1] = false;
        }
    }

    if (dp[1 - N % 2][0][0]) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}
0