結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー suakii
提出日時 2019-05-01 12:01:28
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 710 bytes
コンパイル時間 1,567 ms
コンパイル使用メモリ 164,808 KB
実行使用メモリ 13,768 KB
最終ジャッジ日時 2024-12-31 12:18:18
合計ジャッジ時間 71,614 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7 TLE * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
const int MAX = 1 << 15;
int dp[MAX];

int main() {
    ios::sync_with_stdio(false);
    int n, t; cin >> n;
    /*
    dp[0] = true;
    for (int i = 0; i < n; i++) {
        cin >> t;
        for (int j = 0; j < MAX; j++)
            if(dp[j])
                dp[t ^ j] = true;
    }
    int ans = 0;
    for (int i = 0; i < MAX; i++)
        if(dp[i])
            ans++;
    cout << ans << endl;
    */
    set<int>a;
    a.insert(0);
    for (auto i = 0; i < n; i++) {
        cin >> t;
        a.insert(t);
    }
    for (auto x : a) {
        for (auto y : a) {
            a.insert(x^y);
        }
    }
    cout << a.size() << endl;
    


    return 0;
}
0