結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー nxterunxteru
提出日時 2018-06-01 23:22:42
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 492 bytes
コンパイル時間 702 ms
コンパイル使用メモリ 66,124 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-12 21:28:22
合計ジャッジ時間 2,635 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 RE -
testcase_08 AC 85 ms
4,384 KB
testcase_09 AC 59 ms
4,380 KB
testcase_10 AC 71 ms
4,384 KB
testcase_11 AC 92 ms
4,384 KB
testcase_12 RE -
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 68 ms
4,380 KB
testcase_15 AC 95 ms
4,384 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 24 ms
4,380 KB
testcase_18 RE -
testcase_19 AC 12 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
typedef long long ll;
bool dp[2][1<<14];
int n,ans;
int main(void){
    dp[0][0]=true;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        int a,u=(i+1)%2;
        scanf("%d",&a);
        for(int j=0;j<1<<14;j++){
            if(dp[i%2][j]){
                dp[u][j]=true;
                dp[u][j^a]=true;
            }
        }
    }
    for(int i=0;i<1<<14;i++)if(dp[n%2][i])ans++;
    printf("%d\n",ans);
}
0