http://acm.hdu.edu.cn/showproblem.php?pid=2897
随便推一下胜负状态,规律太明显了,1~p负,p+1~p+q胜,之后循环。
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,p,q;
while(cin>>n>>p>>q)
{
n=(n-1)%(q+p);
if(n<p) cout<<"LOST"<<endl;
else cout<<"WIN"<<endl;
}
}