結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー maine_honzuki
提出日時 2020-11-18 21:59:01
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 362 bytes
コンパイル時間 2,241 ms
コンパイル使用メモリ 197,928 KB
最終ジャッジ日時 2025-01-16 01:36:04
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int N;
    set<int> S;

    cin >> N;

    while (N--) {
        int A;
        cin >> A;
        auto it = S.rbegin();
        while (it != S.rend()) {
            A = min(A, A ^ *it);
            it++;
        }
        S.insert(A);
    }
    S.erase(0);
    cout << (1 << (S.size())) << endl;
}
0