比赛 |
集训 |
评测结果 |
WWWEEEEEEE |
题目名称 |
镜牢 |
最终得分 |
0 |
用户昵称 |
rb_tree |
运行时间 |
1.104 s |
代码语言 |
C++ |
内存使用 |
3.72 MiB |
提交时间 |
2025-07-03 11:46:43 |
显示代码纯文本
#include<bits/stdc++.h>
#define int long long
using namespace std;
int read()
{
int x=0,w=1;
char ch=0;
while(ch<'0'||ch>'9')
{
if(ch=='-') w=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9')
{
x=(x<<1)+(x<<3)+(ch^48);
ch=getchar();
}
return x*w;
}
void write(int x)
{
if(x<0)
{
putchar('-');
x=-x;
}
if(x>=10) write(x/10);
putchar((x%10)^48);
}
const int N=5e4+5;
int a[N],b[N],c[N],n,ans;
bool ab[N];
void dfs(int x)
{
if(x==n)
{
int tmp=0;
for(int i=1;i<=n;i++)
{
if(ab[i]) tmp^=a[i];
else tmp^=b[i];
ans=max(ans,tmp);
}
return;
}
dfs(x+1);
ab[x]=1;
dfs(x+1);
}
signed main()
{
freopen("mirror.in","r",stdin);
freopen("mirror.out","w",stdout);
n=read();
for(int i=1;i<=n;i++) a[i]=read();
for(int i=1;i<=n;i++) b[i]=read();
for(int i=1;i<=n;i++) c[i]=read();
dfs(1);
write(ans);
fclose(stdin);
fclose(stdout);
return 0;
}
/*
3
6 1 2
6 2 3
0 1 0
*/
/*
6
*/