結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー sugarrrsugarrr
提出日時 2018-01-04 15:45:50
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 591 bytes
コンパイル時間 735 ms
コンパイル使用メモリ 67,604 KB
実行使用メモリ 163,648 KB
最終ジャッジ日時 2023-08-24 18:55:01
合計ジャッジ時間 3,730 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 172 ms
120,860 KB
testcase_11 AC 217 ms
158,140 KB
testcase_12 AC 3 ms
4,384 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 47 ms
38,660 KB
testcase_18 AC 184 ms
141,800 KB
testcase_19 AC 24 ms
20,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #



#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
typedef long long ll;
using namespace std;

int main(){
    int n;cin>>n;
    int a[n+1];for(int i=1;i<=n;i++)cin>>a[i];
    bool dp[n+1][32769];
    for(int i=1;i<=32767;i++)dp[0][i]=false;
    dp[0][0]=true;
    for(int i=1;i<=n;i++)for(int j=0;j<=32767;j++){
        dp[i][j]=dp[i-1][j]||dp[i-1][j^a[i]];
    }
    int ans=0;for(int i=0;i<=32768;i++)if(dp[n][i]==true)ans++;cout<<ans<<endl;
    return 0;
}
0