結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー srjywrdnprktsrjywrdnprkt
提出日時 2022-12-26 03:42:40
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 871 bytes
コンパイル時間 1,082 ms
コンパイル使用メモリ 112,324 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-30 13:59:23
合計ジャッジ時間 4,842 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 WA -
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 70 ms
6,944 KB
testcase_09 AC 16 ms
6,940 KB
testcase_10 AC 54 ms
6,940 KB
testcase_11 AC 39 ms
6,944 KB
testcase_12 AC 81 ms
6,944 KB
testcase_13 AC 91 ms
6,940 KB
testcase_14 AC 53 ms
6,940 KB
testcase_15 AC 95 ms
6,940 KB
testcase_16 AC 79 ms
6,940 KB
testcase_17 AC 85 ms
6,944 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 AC 2 ms
6,944 KB
testcase_20 AC 26 ms
6,944 KB
testcase_21 AC 103 ms
6,940 KB
testcase_22 AC 101 ms
6,940 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 2 ms
6,940 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 60 ms
6,940 KB
testcase_29 AC 84 ms
6,944 KB
testcase_30 AC 75 ms
6,944 KB
testcase_31 AC 64 ms
6,940 KB
testcase_32 AC 79 ms
6,944 KB
testcase_33 AC 97 ms
6,940 KB
testcase_34 AC 98 ms
6,944 KB
testcase_35 AC 99 ms
6,944 KB
testcase_36 AC 101 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
#include <cassert>

using namespace std;

int main(){

    long long N, rank=0;
    cin >> N;
    deque<long long> A(N);
    for (int i=0; i<N; i++) cin >> A[i];

    for (int i=0; i<=60; i++){
        bool f=0;
        if (1LL<<i & A[i]) f = 1;
        else{
            for (int j=i+1; j<N; j++){
                if (1LL<<i & A[j]){
                    swap(A[i], A[j]);
                    f = 1;
                    break;
                }
            }
        }
        if (f){
            rank++;
            for (int j=i+1; j<N; j++){
                if (1LL<<i & A[j]) A[j] ^= A[i];
            }
        }
    }

    cout << (1LL<<rank) << endl;

    return 0;
}
0