結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー nejinejinejineji
提出日時 2021-02-03 21:11:31
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 72 ms / 5,000 ms
コード長 1,125 bytes
コンパイル時間 3,682 ms
コンパイル使用メモリ 227,892 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-12 16:53:02
合計ジャッジ時間 7,752 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 AC 1 ms
4,384 KB
testcase_06 AC 2 ms
4,384 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 51 ms
4,384 KB
testcase_09 AC 12 ms
4,384 KB
testcase_10 AC 39 ms
4,384 KB
testcase_11 AC 28 ms
4,384 KB
testcase_12 AC 59 ms
4,384 KB
testcase_13 AC 64 ms
4,380 KB
testcase_14 AC 37 ms
4,388 KB
testcase_15 AC 69 ms
4,384 KB
testcase_16 AC 58 ms
4,380 KB
testcase_17 AC 62 ms
4,380 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 16 ms
4,384 KB
testcase_21 AC 72 ms
4,384 KB
testcase_22 AC 72 ms
4,384 KB
testcase_23 AC 2 ms
4,384 KB
testcase_24 AC 2 ms
4,384 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,384 KB
testcase_27 AC 2 ms
4,384 KB
testcase_28 AC 44 ms
4,380 KB
testcase_29 AC 62 ms
4,388 KB
testcase_30 AC 54 ms
4,384 KB
testcase_31 AC 47 ms
4,384 KB
testcase_32 AC 58 ms
4,380 KB
testcase_33 AC 70 ms
4,384 KB
testcase_34 AC 69 ms
4,384 KB
testcase_35 AC 70 ms
4,380 KB
testcase_36 AC 71 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
#define REP(i, x, y) for (ll i = x; i <= y; i++)
#define BIT(t) (1ll << (t))
#define PER(i, y, x) for (ll i = y; i >= x; i--)
#define vll vector<ll>
#define vvll vector<vector<ll>>
#define pll pair<ll, ll>
#define SIZE(v) ll(v.size())
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef long double ld;
//        ios::sync_with_stdio(false);
//        cin.tie(nullptr);

using mint = modint;
//         mint::set_mod(998244353);

vll xor_basis(vll& a){
        vector<ll> basis;
        for(ll e : a){
                for(ll b : basis){
                        e = min(e, e ^ b);
                }
                if(e){basis.push_back(e);}        
        }
return basis;
}
int main(){
        ll n;
        cin >> n;
        vll a;
        REP(i,1,n){
                ll t;
                cin >> t;
                a.push_back(t);
        }
        vll b = xor_basis(a);
        ll ans = 1;
        REP(i,1,b.size()){
                ans *= 2;
        }
        cout << ans << endl;
}
0