hdu1846(博弈)

来源:互联网 发布:java html标签转pdf 编辑:程序博客网 时间:2024/05/17 04:48
//这题是很简单的博弈论//分析一两个数据你就发现这个博弈的一个规律//当n%(m+1)==0时,second赢,否则first赢#include <iostream>using namespace std;int main(){    int n,m;    int t;    cin>>t;    while(t--)    {        cin>>n>>m;        if(n%(m+1)==0)        {            cout<<"second"<<endl;        }        else        {            cout<<"first"<<endl;        }    }    return 0;}

0 0