結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー trineutrontrineutron
提出日時 2021-01-04 04:15:47
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 428 bytes
コンパイル時間 2,026 ms
コンパイル使用メモリ 199,400 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-22 00:32:22
合計ジャッジ時間 3,973 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 3 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 WA -
testcase_08 AC 123 ms
5,376 KB
testcase_09 AC 88 ms
5,376 KB
testcase_10 AC 104 ms
5,376 KB
testcase_11 AC 137 ms
5,376 KB
testcase_12 WA -
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 325 ms
5,376 KB
testcase_15 AC 138 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 33 ms
5,376 KB
testcase_18 WA -
testcase_19 AC 17 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a.at(i);
    }
    vector<bool> dp(1 << 14);
    dp.at(0) = true;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 1 << 14; j++) {
            dp.at(j) = dp.at(j) || dp.at(a.at(i) ^ j);
        }
    }
    cout << count(dp.begin(), dp.end(), true) << endl;
}
0