結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー Yuki InoueYuki Inoue
提出日時 2023-12-19 09:28:13
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 609 bytes
コンパイル時間 3,039 ms
コンパイル使用メモリ 249,452 KB
実行使用メモリ 663,680 KB
最終ジャッジ日時 2023-12-19 09:28:23
合計ジャッジ時間 9,841 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,676 KB
testcase_01 AC 3 ms
6,676 KB
testcase_02 AC 4 ms
6,676 KB
testcase_03 AC 3 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 3 ms
6,676 KB
testcase_06 AC 3 ms
6,676 KB
testcase_07 MLE -
testcase_08 MLE -
testcase_09 AC 484 ms
405,632 KB
testcase_10 AC 560 ms
488,192 KB
testcase_11 MLE -
testcase_12 AC 5 ms
6,676 KB
testcase_13 AC 3 ms
6,676 KB
testcase_14 MLE -
testcase_15 MLE -
testcase_16 AC 5 ms
6,676 KB
testcase_17 AC 177 ms
149,248 KB
testcase_18 MLE -
testcase_19 AC 81 ms
74,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
ll INF = 1e18;

int main(){
    int N;
    cin >> N;

    vector<vector<int> > dp(N+1, vector<int>(32769, 0));
    dp[0][0] = 1;

    int a;
    rep(i,1,N+1){
        cin >> a;
        rep(j,0,32769){
            if(dp[i-1][j] == 1){
                dp[i][j] = 1;
                int new_num = j ^ a;
                dp[i][new_num] = 1; 
            }
        }
    }

    cout << accumulate(dp[N].begin(), dp[N].end(), 0) << endl;
}
0