結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー nxteru
提出日時 2018-06-01 23:22:42
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 492 bytes
コンパイル時間 520 ms
コンパイル使用メモリ 65,920 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-30 08:58:55
合計ジャッジ時間 2,382 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15 RE * 3
権限があれば一括ダウンロードができます

ソースコード

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