#include<bits/stdc++.h>
#define maxn 100010
#define int long long
using namespace std;
template<class T>int read(T &__x){__x=0;short __f=1;char __ch=getchar();while(__ch<'0'||__ch>'9'){if(__ch=='-')__f=-1;__ch=getchar();}while(__ch>='0'&&__ch<='9'){__x=(__x<<1)+(__x<<3)+(__ch^48);__ch=getchar();}__x*=__f;return __x;}
int n,m,q,t;
int x,y;
int f[101][20001];
int ans[20001];
int head[maxn],Next[maxn],ver[maxn],tot=1;
void add(int x,int y){
ver[++tot]=y;
Next[tot]=head[x];
head[x]=tot;
}
int ask(int x,int t){
if(f[x][t]>=0)return f[x][t];
int ans=0;
// printf("f[%d][%d] = ",x,t);
for(int i=head[x];i;i=Next[i]){
// printf("f[%d][%d] ^ ",ver[i],t-1);
ans^=ask(ver[i],t-1);
}
// puts("");
return f[x][t]=ans;
}
namespace task{
bool check(int x){
for(int i=1;i<=10;i++)
if(ans[6000+i*10101%131+x]!=ans[6000+i*10101%131])
return 0;
return 1;
}
int MAIN(){
for(int len=1;len<=8000;len++)
if(check(len))return len;
return 0;
}
}
using namespace task;
signed main(){
// freopen("magic.in","r",stdin);
// freopen("magic.out","w",stdout);
read(n),read(m),read(q);
memset(f,-1,sizeof f);
for(int i=1;i<=n;i++)read(f[i][0]);
for(int i=1;i<=m;i++){
read(x),read(y);
add(x,y);add(y,x);
}
if(m==n*(n-1)/2){
while(q--){
read(t);
printf("%lld\n",ask(1,(t&1)+2));
}
return 0;
}
for(int i=1;i<=20000;i++)
ans[i]=ask(1,i);
// for(int i=1;i<=20000;i++)printf("%lld ",ans[i]);
int u=MAIN();
while(q--){
read(t);
if(t<=20000)printf("%lld\n",ans[t]);
else printf("%lld\n",ans[t%u+8000/u*u]);
}
}
考场上已经拿到70pts的好成绩了,dalao们能不能想想办法用随机卡过去。
壮哉我随机!!!