結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー tubo28tubo28
提出日時 2015-05-09 20:14:13
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 2,175 bytes
コンパイル時間 1,102 ms
コンパイル使用メモリ 144,092 KB
実行使用メモリ 4,412 KB
最終ジャッジ日時 2023-09-17 16:49:50
合計ジャッジ時間 3,638 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 WA -
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,384 KB
testcase_08 AC 37 ms
4,380 KB
testcase_09 AC 9 ms
4,376 KB
testcase_10 AC 29 ms
4,380 KB
testcase_11 AC 20 ms
4,376 KB
testcase_12 AC 43 ms
4,380 KB
testcase_13 AC 46 ms
4,380 KB
testcase_14 AC 27 ms
4,380 KB
testcase_15 AC 49 ms
4,376 KB
testcase_16 AC 42 ms
4,380 KB
testcase_17 AC 45 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 8 ms
4,376 KB
testcase_21 AC 51 ms
4,376 KB
testcase_22 AC 51 ms
4,380 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 1 ms
4,380 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 32 ms
4,376 KB
testcase_29 AC 43 ms
4,376 KB
testcase_30 AC 38 ms
4,376 KB
testcase_31 AC 32 ms
4,380 KB
testcase_32 AC 41 ms
4,376 KB
testcase_33 AC 49 ms
4,380 KB
testcase_34 AC 49 ms
4,380 KB
testcase_35 AC 50 ms
4,376 KB
testcase_36 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#define int ll
//#define endl "\n"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
#define all(c) (c).begin(), (c).end()
#define loop(i,a,b) for(ll i=a; i<ll(b); i++)
#define rep(i,b) loop(i,0,b)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
template<class T> ostream & operator<<(ostream & os, vector<T> const &);
template<int n, class...T> typename enable_if<(n>=sizeof...(T))>::type _ot(ostream &, tuple<T...> const &){}
template<int n, class...T> typename enable_if<(n< sizeof...(T))>::type _ot(ostream & os, tuple<T...> const & t){ os << (n==0?"":" ") << get<n>(t); _ot<n+1>(os, t); }
template<class...T> ostream & operator<<(ostream & os, tuple<T...> const & t){ _ot<0>(os, t); return os; }
template<class T, class U> ostream & operator<<(ostream & os, pair<T,U> const & p){ return os << "(" << p.first << ", " << p.second << ") "; }
template<class T> ostream & operator<<(ostream & os, vector<T> const & v){ rep(i,v.size()) os << v[i] << (i+1==(int)v.size()?"":" "); return os; }
template<class T> inline bool chmax(T & x, T const & y){ return x<y ? x=y,true : false; }
template<class T> inline bool chmin(T & x, T const & y){ return x>y ? x=y,true : false; }
#ifdef DEBUG
#define dump(...) (cerr<<#__VA_ARGS__<<" = "<<mt(__VA_ARGS__)<<" ["<<__LINE__<<"]"<<endl)
#else
#define dump(...)
#endif
// ll const mod = 1000000007;
// ll const inf = 1LL<<60;

int N;
ll A[100010];
signed main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> N;
    rep(i,N) cin >> A[i];

    // srand(time(0));
    // N = 10;
    // rep(i,N) A[i] = rand();

    int rank = 0;
    rep(i,N){
        int piv = -1;
        loop(j,i,64){
            if(A[j]>>i&1){
                piv = j;
                rank++;
                break;
            }
        }
        if(piv == -1) continue;
        swap(A[i],A[piv]);
        loop(j,i+1,N){
            if(A[j]>>i&1) A[j] ^= A[i];
        }
    }
    rep(i,N){
        dump(bitset<64>(A[i]));
    }
    cout << (1ull << rank) << endl;
}
0