传送门
同样有一个显然的结论。
如果
a
1
a_1
a1
x
o
r
xor
xor
a
2
a_2
a2
x
o
r
xor
xor
a
3
a_3
a3
x
o
r
.
.
.
xor...
xor...
x
o
r
xor
xor
a
n
a_n
an为0那么后手胜。
否则先手胜。
这个可以用二进制的对称性来辅助思考。
代码:
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,x=0,y;
cin>>n;
for(int i=1;i<=n;++i)cin>>y,x^=y;
if(x)cout<<"win";
else cout<<"lose";
return 0;
}