题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1846
题目大意:中文题目
解题思路:巴什博奕,若n为(m+1)的倍数,则后手赢,否则先手赢。
AC代码:
#include <iostream>
using namespace std;
int main()
{
int t;
int n,m;
cin>>t;
while(t--)
{
cin>>n>>m;
if(n%(m+1)==0)cout<<"second"<<endl;
else cout<<"first"<<endl;
}
return 0;
}
&spm=1001.2101.3001.5002&articleId=50312077&d=1&t=3&u=f387888f3a1e47d0ae02140397c93390)
1062

被折叠的 条评论
为什么被折叠?



