QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#60403 | #4446. Link is as bear | qinjianbin# | WA | 316ms | 2400kb | C++17 | 697b | 2022-11-04 14:10:19 | 2022-11-04 14:10:21 |
Judging History
answer
#include<cstdio>
typedef long long LL;
const int maxn =1e5+5;
const int log2maxn =60;
int n;
LL p[maxn];
LL a[maxn];
void standing_by()
{
int i,j;
LL k;
for(i=0;i<log2maxn;i++)
p[i]=0;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%lld",&a[i]);
if (a[i]==0) continue;
k=a[i];
for(j=log2maxn-1;j>=0;j--)
if ((k>>j)&1)
{
if (p[j]==0)
{
p[j]=k;
break;
}else {
k^=p[j];
}
}
}
}
void complete()
{
LL ans=0;
int i;
for(i=log2maxn-1;i>=0;i--)
ans^=p[i];
printf("%lld\n",ans);
}
int main()
{
int t;
scanf("%d",&t);
for(;t;t--)
{
standing_by();
complete();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 316ms
memory: 2400kb
input:
22222 100000 595189703884863 72716684812661 449525802123580 504421888022388 390139608591346 108895143840760 170477720052912 185583843894744 201608404318832 128831549357316 521084715261656 668960191579878 573530403227342 489014525501629 56366633717911 1705111713690 227582321537214 710815946393065 169...
output:
851373153001164 612032023167443 1016837633626625 783275788173276 1086515099867937 639004404945342 847989347053611 1019388287669944 994838183561492 960305429391614 567157530390099 1086116592375112 701757362698794 896124391466167 1071722233119376 1095770239460688 858302997325610 987035096888574 901471...
result:
wrong answer 1st lines differ - expected: '1125899906842623', found: '851373153001164'