小 H:使最后两个数相同,要把所有个数 的数全部去掉,使其他的数个数都 。
小 Y:使最后两个数不相同,要把所有个数 的数全部去掉,只剩 个,使其他的数个数都 。
那么,我们把小 Y 需要去掉的数算出来,记为 。
每个人只能取 次,那么如果 ,小 Y 就取不完了,此时输出 Lose,否则输出 Win。
代码:
#include<bits/stdc++.h>
#define int long long
#define double long double
#define debug(x) cout<<#x<<"->"<<x<<endl<<flush
#define endl '\n'
#define inf INT_MAX
using namespace std;
const int N=1e7+7;
const int M=1e6+7;
const int mod=1e9+7;
const double eps=1e-6;
signed main(){
ios::sync_with_stdio(0);
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
int t;
cin >>t;
while(t--){
int n;
cin >>n;
map<int,bool>m;
int ans=0;
for(int i=0;i<2*n;i++){
int x;cin >>x;
if(m[x])ans++;//之前就有过这个数,数量 >=2,ans 加一
m[x]=1;//有过这个数了
}
if(ans>n-1){//小 Y 取不完,输了
cout<<"Lose"<<endl;
}else{//小 H 取不完,赢了
cout<<"Win"<<endl;
}
}
return 0;
}