题目传送门:点击打开链接
题目可以转换为威佐夫博弈,向左,向下为在一堆石头中取任意数目的石子,向左下可以理解为从两堆石头中取相同数目的石子。直接利用威佐夫博弈结论解题。
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,k) for(int i=j;i<=k;i++)
typedef long long ll;
int main(){
int a,b;
while(cin>>a>>b){
if(a>b) swap(a,b);
if(a==floor((b-a)*1.6180339887498948)){
cout<<"Lao Wang"<<endl;
}else cout<<"Xiao Ren"<<endl;
}
return 0;
}