传送门
Nim Game 板子题。
本题显然为 Nim Game,只需判断 即可。
如果等于 ,后手获胜,否则先手获胜。
CODE:
int n,x,ans;
int main(void){
n=read();
while(n--){
x=read();
ans^=x;
}
if(ans==0){
puts("lose");
}else{
puts("win");
}
return 0;
}传送门
Nim Game 板子题。
本题显然为 Nim Game,只需判断 即可。
如果等于 ,后手获胜,否则先手获胜。
CODE:
int n,x,ans;
int main(void){
n=read();
while(n--){
x=read();
ans^=x;
}
if(ans==0){
puts("lose");
}else{
puts("win");
}
return 0;
}