UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#190557#3380. xorBK0717100180ms1252kbC++111.6kb2023-10-06 09:57:082023-10-06 12:01:17

answer

#include<bits/stdc++.h>
#define il inline
#define x first
#define y second
#define sd std::
#define op operator
#define de(yh) #yh,'=',yh
#define ast(yx,bk) ((yx)||(clg("AST ",__LINE__,'\n',de(bk)),exit(7),7))
#define fr(js) freopen(#js".in","r",stdin),freopen(#js".out","w",stdout)
using LL=long long;using pii=sd pair<int,int>;
#define rd(js) sd cin>>js
template<class js>il bool cn(js&y,js x){return y>x?y=x,true:false;}template<class js>il bool cx(js&y,js x){return y<x?y=x,true:false;}
template<class yx>il int wrt(yx js){return sd cout<<js,7;}template<class J,class...S>il int wrt(J y,S...x){return wrt(y),wrt(x...),7;}
#ifdef Bella
template<class yx>il int clg(yx js){return sd cerr<<js,7;}
#else
template<class yx>il int clg(yx js){return 7;}
#endif
template<class J,class...S>il int clg(J y,S...x){return clg(y),clg(x...),7;}
const int N=33;
int n,d[N];
il void Init()
{
  rd(n);
  for(int i=0,x;i<n;++i)
  {
    rd(x);
    for(int i=30;~i;--i) if(x>>i&1)
    {
      if(d[i]) x^=d[i];
      else
      {
        d[i]=x;
        break;
      }
    }
  }
  LL ans=0,cnt=-1;
  for(int i=30;~i;--i) ans|=d[i],cnt+=!!d[i];
  wrt(ans*(1ll<<cnt));
  return;
}
il void Solve()
{
  return;
}
// Wonder what you're doing for the rest of your life ?
main()
{
#ifdef Bella
  fr(1);
#elif ONLINE_JUDGE
#else
  fr(BK0717);
#endif
  sd ios::sync_with_stdio(0),sd cin.tie(0),sd cout.tie(0);
  int T=1;
  for(;T--;Init(),Solve());
#ifdef Bella
  clg('\n',1e3*clock()/CLOCKS_PER_SEC,"ms\n","BK, What? Why? How?\n");
#endif
  return 0;
}
/*
g++ 7.cpp -o 7 -std=c++14 -O2 -lm -Wall -Wshadow -DBella
*/

详细

小提示:点击横条可展开更详细的信息

Test #1:

score: 10
Accepted
time: 0ms
memory: 1240kb

input:

1
0

output:

0

result:

ok single line: '0'

Test #2:

score: 10
Accepted
time: 18ms
memory: 1252kb

input:

100000
65921 198375 21586 38561 397862 231047 214055 475329 133011 759024 181248 331796 677542 10327...

output:

68047798272

result:

ok single line: '68047798272'

Test #3:

score: 10
Accepted
time: 19ms
memory: 1252kb

input:

100000
677027 820321 557474 70635 668211 742187 333000 807730 553720 880897 448250 504907 37563 2146...

output:

137169862656

result:

ok single line: '137169862656'

Test #4:

score: 10
Accepted
time: 18ms
memory: 1252kb

input:

100000
19965 479774 56172 281200 333015 35825 447368 476544 476331 513079 465656 312879 511426 82975...

output:

67645603840

result:

ok single line: '67645603840'

Test #5:

score: 10
Accepted
time: 16ms
memory: 1252kb

input:

100000
857727 839078 518837 441723 868634 712311 149274 174410 910286 290333 165547 1019132 415544 1...

output:

274877644800

result:

ok single line: '274877644800'

Test #6:

score: 10
Accepted
time: 19ms
memory: 1248kb

input:

100000
508190 818044 445053 771099 163392 437294 982637 725539 88101 831756 736077 289071 492073 993...

output:

274844090368

result:

ok single line: '274844090368'

Test #7:

score: 10
Accepted
time: 23ms
memory: 1252kb

input:

100000
354185019 666591573 788482649 1053188434 745934094 29050950 850330965 44770138 672555111 1038...

output:

72055111479721984

result:

ok single line: '72055111479721984'

Test #8:

score: 10
Accepted
time: 22ms
memory: 1252kb

input:

100000
168692682 146806924 180981378 441140484 479478730 378569246 306272158 234996946 206638618 513...

output:

4345200948281344

result:

ok single line: '4345200948281344'

Test #9:

score: 10
Accepted
time: 22ms
memory: 1252kb

input:

100000
592447371 856214398 558635630 352846294 538016599 589357573 892700581 318770198 913614510 684...

output:

62478648669634560

result:

ok single line: '62478648669634560'

Test #10:

score: 10
Accepted
time: 23ms
memory: 1248kb

input:

100000
864560252 956306323 403708676 410585270 67247857 394338323 943268623 779170496 587868844 2817...

output:

72036703249891328

result:

ok single line: '72036703249891328'