QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#51642 | #4810. Add One | Crysfly | WA | 2ms | 3652kb | C++11 | 734b | 2022-10-03 10:10:04 | 2022-10-03 10:10:05 |
Judging History
answer
// what is matter? never mind.
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
#define int long long
using namespace std;
inline int read()
{
char c=getchar();int x=0;bool f=0;
for(;!isdigit(c);c=getchar())f^=!(c^45);
for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
if(f)x=-x;return x;
}
#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;
#define maxn 500005
#define inf 0x3f3f3f3f
int n,a[maxn],res,sum;
signed main()
{
n=read();
For(i,1,n)a[i]=read(),sum^=a[i];
For(i,1,n)res=max(res,sum^a[i]^(a[i]+1));
cout<<res;
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3652kb
input:
4 1 2 1 2
output:
3
result:
wrong answer 1st numbers differ - expected: '7', found: '3'