思路:请原谅刚开始博弈,不知道这是一道什么类型的博弈.
不过思路是这样的.
我是从必败态开始找.
很容易看出
假设x为初始个个数,必败态为T,必胜态为S(都是对于先手,或者说面对该情况的人而言)
x<=p T
p<x<=q+p S(可以使得对手陷入必败态)
进而推出
q+p<x<=q+2p T
q+2p<x<=2q+2p S
...
所以x%(p+q)余数在(0,p)之间就必败,其他情况必胜!
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
int n,p,q;
while(~scanf("%d%d%d",&n,&p,&q))
{
bool flag=true;
n=n%(p+q);
if(n<=p&&n!=0)
flag=false;
if(flag)
cout<<"WIN"<<endl;
else
cout<<"LOST"<<endl;
}
}