QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#197279 | #4446. Link is as bear | yiyiyi# | WA | 58ms | 3580kb | C++14 | 1.0kb | 2023-10-02 14:00:03 | 2023-10-02 14:00:03 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
#define inf 0x3f3f3f3f
#define re register
#define N 200203
#define pii pair<int,int>
#define fi first
#define se second
using namespace std;
const int mo=1000000007;
struct bit{
int a[64];
const int m=51;
bit(){memset(a,0,sizeof(a));}
bool ins(int x){
for (int i=m;~i;--i)
if (x&(1ll<<i))
if (!a[i]){a[i]=x;return 1;}
else x^=a[i];
return 0;
}
bool check(int x){
for (int i=m;~i;--i)
if (x&(1ll<<i))
if (!a[i])return 0;
else x^=a[i];
return 1;
}
int getmx(){
int res=0;
for (int i=m;~i;--i)
if ((res^a[i])>res)
res^=a[i];
return res;
}
}b;
inline int read(){
int x=0,w=0;char ch=getchar();
while (!isdigit(ch))w|=ch=='-',ch=getchar();
while (isdigit(ch))x=(x<<1)+(x<<3)+ch-'0',ch=getchar();
return w?-x:x;
}
void solve(){
memset(&b,0,sizeof b);
int n=read(),ans=0,xo=0;
for (int i=1;i<=n;++i)b.ins(read());
cout<<b.getmx()<<endl;
}
signed main(){
int T=read();
while (T--)solve();
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 58ms
memory: 3580kb
input:
22222 100000 595189703884863 72716684812661 449525802123580 504421888022388 390139608591346 108895143840760 170477720052912 185583843894744 201608404318832 128831549357316 521084715261656 668960191579878 573530403227342 489014525501629 56366633717911 1705111713690 227582321537214 710815946393065 169...
output:
595189703884863 437604461416209 825211746856885 469120289987251 334910018723827 852361019898705 638306631661613 845195791114983 212871012876015 300845560591599 173553505319579 2868971736499 930571761262841 41375789398277 69403798546213 17265864971929 700576679793615 63561208747307 247329966779621 63...
result:
wrong answer 1st lines differ - expected: '1125899906842623', found: '595189703884863'