結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー otamay6otamay6
提出日時 2019-11-18 10:31:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 560 bytes
コンパイル時間 1,721 ms
コンパイル使用メモリ 173,936 KB
実行使用メモリ 13,760 KB
最終ジャッジ日時 2024-04-08 13:47:42
合計ジャッジ時間 5,337 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 3 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 3 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 WA -
testcase_08 AC 332 ms
12,648 KB
testcase_09 AC 230 ms
9,856 KB
testcase_10 AC 277 ms
11,136 KB
testcase_11 AC 359 ms
13,412 KB
testcase_12 WA -
testcase_13 AC 2 ms
6,676 KB
testcase_14 AC 370 ms
13,760 KB
testcase_15 AC 373 ms
13,760 KB
testcase_16 AC 3 ms
6,676 KB
testcase_17 AC 82 ms
6,676 KB
testcase_18 WA -
testcase_19 AC 43 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define All(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;

int main(){
    int N;cin>>N;
    vector<int> A(N);
    REP(i, N) cin >> A[i];
    vector<vector<bool>> dp(N+1,vector<bool>((1<<14)+1,false));
    dp[0][0]=true;
    REP(i,N) REP(j,(1<<14)+1){
        dp[i+1][j] = dp[i][j]|dp[i][min(j^A[i],1<<14)];
    }
    int ans=0;
    REP(i,(1<<14)+1) if(dp[N][i]){
        ans++;
    }
    cout<<ans<<endl;
}
0