結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー ugis_progugis_prog
提出日時 2018-09-30 17:33:05
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 377 ms / 5,000 ms
コード長 752 bytes
コンパイル時間 1,477 ms
コンパイル使用メモリ 149,476 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-13 20:14:30
合計ジャッジ時間 5,222 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 3 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 377 ms
4,376 KB
testcase_08 AC 331 ms
4,380 KB
testcase_09 AC 227 ms
4,380 KB
testcase_10 AC 273 ms
4,376 KB
testcase_11 AC 359 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 310 ms
4,376 KB
testcase_15 AC 372 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 82 ms
4,376 KB
testcase_18 AC 345 ms
4,380 KB
testcase_19 AC 42 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9;
const int MOD = INF+7;
const ll LINF = 1e18;
#define rep(i,N) for(int (i)=0;(i)<(N);++(i))
#define rrep(i,N) for(int (i)=(N-1);(i)>0;--i)
#define FOR(i,j,N) for(int (i)=(j);(i)<(N);++(i))
#define put(n) cout<<(n)<<endl;
#define VI vector<int>
#define VII vector<vector<int>>
#define all(v) v.begin(),v.end()
#define MP make_pair
#define pb(n) push_back(n)


int main(){
    int N; cin>>N;
    vector<int> A(N);
    rep(i,N) cin>>A[i];

    vector<bool> dp((1<<15),false);
    dp[0] = true;

    rep(i,N){
        rep(j,(1<<15)){
            if(dp[j]) dp[j^A[i]] = true; 
        }
    }

    int ans = 0;
    rep(i,(1<<15)) ans += dp[i]?1:0;
    cout<<ans<<endl;
}
0