結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー aaaaaaiu
提出日時 2019-08-08 12:49:34
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 151 ms / 5,000 ms
コード長 384 bytes
コンパイル時間 2,201 ms
コンパイル使用メモリ 192,456 KB
最終ジャッジ日時 2025-01-07 11:00:37
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int n;
    cin>>n;
    bool dp[1<<15]{};
    dp[0]=true;
    for (int i=0;i<n;i++) {
        int a;
        cin>>a;
        for (int i=0;i<1<<15;i++) {
            if (dp[i]) dp[i^a]=true;
        }
    }
    int ans=0;
    for (int i=0;i<1<<15;i++) ans+=dp[i];
    cout<<ans<<endl;
    return 0;
}
0