結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー けーむけーむ
提出日時 2020-07-08 16:29:16
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,180 bytes
コンパイル時間 1,970 ms
コンパイル使用メモリ 170,440 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-14 23:02:25
合計ジャッジ時間 4,533 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 3 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 WA -
testcase_08 AC 262 ms
6,944 KB
testcase_09 AC 181 ms
6,940 KB
testcase_10 AC 216 ms
6,940 KB
testcase_11 AC 285 ms
6,940 KB
testcase_12 WA -
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 109 ms
6,940 KB
testcase_15 AC 296 ms
6,944 KB
testcase_16 AC 2 ms
6,940 KB
testcase_17 AC 67 ms
6,944 KB
testcase_18 WA -
testcase_19 AC 33 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())
#define endl "\n"

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    const ll mv = 16384;
    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    vector<vector<bool>> dp(2, vector<bool>(mv + 1, false));
    dp[0][0] = true;
    rep(i, n) {
        fill(all(dp[(i + 1) % 2]), false);
        rep(j, mv + 1) {
            if (!dp[i % 2][j]) continue;
            dp[(i + 1) % 2][j] = true;
            ll v = j ^ a[i];
            if (v > mv) continue;
            dp[(i + 1) % 2][v] = true;
        }
    }
    ll ans = 0;
    rep(i, mv + 1) {
        if (dp[n % 2][i]) ans++;
    }
    cout << ans << endl;
    return 0;
}
0