結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー YS55749378YS55749378
提出日時 2022-03-29 15:59:15
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 443 ms / 5,000 ms
コード長 855 bytes
コンパイル時間 1,749 ms
コンパイル使用メモリ 172,784 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-25 21:20:35
合計ジャッジ時間 11,170 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 296 ms
6,940 KB
testcase_09 AC 57 ms
6,940 KB
testcase_10 AC 232 ms
6,940 KB
testcase_11 AC 154 ms
6,940 KB
testcase_12 AC 349 ms
6,940 KB
testcase_13 AC 391 ms
6,944 KB
testcase_14 AC 219 ms
6,940 KB
testcase_15 AC 424 ms
6,940 KB
testcase_16 AC 355 ms
6,940 KB
testcase_17 AC 371 ms
6,944 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 AC 2 ms
6,944 KB
testcase_20 AC 22 ms
6,940 KB
testcase_21 AC 439 ms
6,940 KB
testcase_22 AC 443 ms
6,944 KB
testcase_23 AC 2 ms
6,944 KB
testcase_24 AC 2 ms
6,944 KB
testcase_25 AC 1 ms
6,944 KB
testcase_26 AC 1 ms
6,940 KB
testcase_27 AC 2 ms
6,944 KB
testcase_28 AC 250 ms
6,944 KB
testcase_29 AC 364 ms
6,940 KB
testcase_30 AC 306 ms
6,940 KB
testcase_31 AC 258 ms
6,940 KB
testcase_32 AC 331 ms
6,944 KB
testcase_33 AC 422 ms
6,948 KB
testcase_34 AC 429 ms
6,940 KB
testcase_35 AC 437 ms
6,944 KB
testcase_36 AC 436 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <utility>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <bits/stdc++.h>
using namespace std;
#define REP2(i,m,n) for(long i=(long)m;i<(long)n;++i)
#define REP(i,n) REP2(i,0,n)

void yesno(bool flag){
    cout<<(flag?"Yes":"No")<<endl;
}

int main(){
    long n;
    cin >> n;
    long a[n];
    REP(i,n) cin >> a[i];
    sort(a,a+n);
    reverse(a,a+n);

    set<long> ans_list;

    REP(i,n){
        long b=62;
        while(b>=0 && ((1LL<<b & a[i])==0)) b--;
        if(b!=-1){
            REP2(j,i+1,n){
                if(1LL<<b & a[j]) a[j]^=a[i];
            }
            sort(a+i+1,a+n);
            reverse(a+i+1,a+n);
            ans_list.insert(b);
          //cout << b << "th bit" << endl;
        }
    }
    long l=ans_list.size();
    cout << (1LL<<l) << endl;
    return 0;
}
0