結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー char134217728char134217728
提出日時 2020-06-08 03:41:42
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 27 ms / 5,000 ms
コード長 1,946 bytes
コンパイル時間 1,666 ms
コンパイル使用メモリ 167,664 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-17 18:16:24
合計ジャッジ時間 3,571 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 19 ms
4,376 KB
testcase_09 AC 6 ms
4,376 KB
testcase_10 AC 15 ms
4,380 KB
testcase_11 AC 11 ms
4,380 KB
testcase_12 AC 22 ms
4,380 KB
testcase_13 AC 24 ms
4,376 KB
testcase_14 AC 14 ms
4,376 KB
testcase_15 AC 27 ms
4,376 KB
testcase_16 AC 22 ms
4,380 KB
testcase_17 AC 24 ms
4,376 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 9 ms
4,380 KB
testcase_21 AC 27 ms
4,376 KB
testcase_22 AC 27 ms
4,376 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 17 ms
4,380 KB
testcase_29 AC 23 ms
4,380 KB
testcase_30 AC 21 ms
4,376 KB
testcase_31 AC 17 ms
4,380 KB
testcase_32 AC 22 ms
4,380 KB
testcase_33 AC 26 ms
4,376 KB
testcase_34 AC 26 ms
4,380 KB
testcase_35 AC 27 ms
4,376 KB
testcase_36 AC 27 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:41:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
   41 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b)  for(int i=(a),i##formax=(b);i< i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formin=(b);i>=i##formin;i--)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max((x),(y))
#define mins(x,y) x=min((x),(y))
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define all(a) ((a).begin()),((a).end())
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define bit(n) (1LL<<(n))
typedef long long ll;
typedef __int128_t lll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>using P=pair<T,Y>;
template<class T,class Y>ostream& operator<<(ostream&o,P<T,Y>&p){return o<<"("<<p.fi<<","<<p.se<<")";}
template<class T>ostream& operator<<(ostream&o,V<T>&v){for(T&t:v)o<<t<<",";return o;}
template<class T>void uniq(V<T>&v){sort(all(v));v.erase(unique(all(v)), v.end());}
template<class A,size_t N,class T>void Fill(A(&a)[N],const T&v){fill((T*)a,(T*)(a+N),v);}

const int MOD = 1e9+7; //998244353;

lll gcd(lll a,lll b,lll&x,lll&y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll modInv(ll a,ll m=MOD){lll x,y;gcd(a,m,x,y);return(x%m+m)%m;}
ll modPow(lll a,lll n,ll m=MOD){lll p=1;for(;n;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return p;}
//V<ll>Fac,Rac;void setF(int n,int m=MOD){Fac=Rac=V<ll>(++n);Fac[0]=1;FOR(i,1,n)Fac[i]=Fac[i-1]*i%m;Rac[n-1]=modInv(Fac[n-1],m);FORR(i,n-1,1)Rac[i-1]=Rac[i]*i%m;}
//ll comb(int a,int b,int m=MOD){return a<b||b<0?0:Fac[a]*Rac[b]%m*Rac[a-b]%m;}

const int IINF = 1e9+6;
const ll LINF = 1e18;
const int N = 1e5;
int n, ans;
V<ll> v;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  scanf("%d", &n);
  FOR(_, 0, n){
    ll a;
    scanf("%lld", &a);
    for(ll l:v) mins(a, a^l);
    if(a) v.pb(a), ans++;
  }
  printf("%lld\n", bit(ans));
}
0