結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー nenuonnenuon
提出日時 2017-06-20 20:33:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 870 bytes
コンパイル時間 716 ms
コンパイル使用メモリ 88,664 KB
実行使用メモリ 101,272 KB
最終ジャッジ日時 2024-04-10 06:27:28
合計ジャッジ時間 2,811 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 WA -
testcase_08 AC 142 ms
90,424 KB
testcase_09 AC 96 ms
63,208 KB
testcase_10 AC 114 ms
75,324 KB
testcase_11 AC 160 ms
98,012 KB
testcase_12 RE -
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 152 ms
101,188 KB
testcase_15 AC 173 ms
101,272 KB
testcase_16 AC 2 ms
6,940 KB
testcase_17 AC 35 ms
25,036 KB
testcase_18 WA -
testcase_19 AC 18 ms
13,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
using namespace std;



int main(){
    int n;
    cin >> n;
    int A[n];
    for(int i = 0; i < n; ++i){
        cin >> A[i];
    }
    bool dp[n+1][20000];
    for(int i = 0; i < n+1; ++i){
        for(int j = 0; j < 20000; ++j){
            dp[i][j] = false;
        }
    }
    dp[0][0] = true;
    for(int i = 0; i < n; ++i){
        for(int j = 0; j < 20000; ++j){
            if(!dp[i][j]) continue;
            dp[i+1][j] = true;
            dp[i+1][j^A[i]] = true;
        }
    }
    int cnt = 0;
    for(int j = 0; j < 20000; ++j){
        if(dp[n][j]) cnt++;
    }
    cout << cnt << endl;
    return 0;
}
0