QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#197278#4446. Link is as bearyiyiyi#WA 6ms3596kbC++141.0kb2023-10-02 13:58:552023-10-02 13:58:56

Judging History

你现在查看的是最新测评结果

  • [2023-10-02 13:58:56]
  • 评测
  • 测评结果:WA
  • 用时:6ms
  • 内存:3596kb
  • [2023-10-02 13:58:55]
  • 提交

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(){
	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=1;
    while (T--)solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 6ms
memory: 3596kb

input:

22222
100000
595189703884863 72716684812661 449525802123580 504421888022388 390139608591346 108895143840760 170477720052912 185583843894744 201608404318832 128831549357316 521084715261656 668960191579878 573530403227342 489014525501629 56366633717911 1705111713690 227582321537214 710815946393065 169...

output:

1125899906842623

result:

wrong answer 2nd lines differ - expected: '1125899906842623', found: ''