結果

問題 No.184 たのしい排他的論理和(HARD)
コンテスト
ユーザー vjudge1
提出日時 2026-10-17 08:39:11
言語 C++14
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 31 ms / 5,000 ms
+ 221µs
コード長 512 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,070 ms
コンパイル使用メモリ 178,836 KB
実行使用メモリ 9,920 KB
最終ジャッジ日時 2026-10-17 08:39:31
合計ジャッジ時間 5,311 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

long long bs[65];

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    int r = 0;
    for (int i = 0; i < n; i++) {
        long long x;
        cin >> x;
        for (int j = 60; j >= 0; j--) {
            if (!(x >> j)) continue;
            if (!bs[j]) {
                bs[j] = x;
                r++;
                break;
            }
            x ^= bs[j];
        }
    }
    cout << (1LL << r) << "\n";
    return 0;
}
0