传送门:http://acm.hdu.edu.cn/showproblem.php?pid=2897
题目大意:中文题目不解释
分析:
同样,分析必胜点必败点就行了。
若当前石子共有n = (p+q)*k 或n = (p+q)*k+r,(p<r<p+q) 个,则为必胜点。
代码
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main()
{
int n,p,q,t;
while(~scanf("%d%d%d",&n,&p,&q))
{
t = n%(p+q);
if(t != 0 &&t <= p)
puts("LOST");
else
puts("WIN");
}
return 0;
}