結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー kpinkcat
提出日時 2023-11-05 16:25:10
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 117 ms / 5,000 ms
コード長 569 bytes
コンパイル時間 1,989 ms
コンパイル使用メモリ 194,304 KB
最終ジャッジ日時 2025-02-17 19:26:04
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<list>
#include<queue>
#include<math.h>
#include<bitset>
using ll = long long;
using namespace std;


int main(){
    int n, MAX = 1 << 15, cnt = 0;
    cin >> n;
    vector<int> dp(MAX);
    dp[0] = 1;
    for (int i = 0; i < n; i++){
        int tmp;
        cin >> tmp;
        for (int j = 0; j < MAX; j++){
            if (dp[j]) dp[j ^ tmp] = 1;
        }
    }
    for (auto x : dp) if (x) cnt++;
    cout << cnt << endl;
}
0