結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー d2verbd2verb
提出日時 2017-10-03 00:21:59
言語 C++11
(gcc 11.4.0)
結果
MLE  
実行時間 -
コード長 528 bytes
コンパイル時間 387 ms
コンパイル使用メモリ 61,192 KB
実行使用メモリ 812,968 KB
最終ジャッジ日時 2024-04-27 18:18:39
合計ジャッジ時間 4,427 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 3 ms
7,768 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 MLE -
testcase_08 MLE -
testcase_09 AC 338 ms
440,176 KB
testcase_10 MLE -
testcase_11 MLE -
testcase_12 AC 5 ms
7,624 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 MLE -
testcase_15 MLE -
testcase_16 AC 4 ms
7,500 KB
testcase_17 AC 124 ms
183,772 KB
testcase_18 MLE -
testcase_19 AC 57 ms
109,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cstring>
using namespace std;

int dp[5001][1<<16];

int main(void) {
    int N;
    vector<int> A;

    cin >> N;
    A.resize(N);

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

    dp[0][0] = 1;
    for (int i = 0; i < N; i++) {
        for (int j = 0; j <= (1 << 15); j++) {
            dp[i+1][j] = dp[i][j] || dp[i][j^A[i]];
        }
    }

    int ans = 0;
    for (int i = 0; i <= (1 << 15); i++) {
        ans += dp[N][i];
    }

    cout << ans << endl;
    return 0;
}
0