Brave Game

http://acm.hdu.edu.cn/showproblem.php?pid=1846

巴什博弈

// File Name: hdu1846.cpp
// Author: bo_jwolf
// Created Time: 2013年10月01日 星期二 16:48:04

#include<vector>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<ctime>

using namespace std;

int main(){
	int n, m, Case; 
	scanf( "%d", &Case );
	while( Case-- ){
		scanf( "%d%d", &n, &m ) ;
		if( n % ( m + 1 ) ) printf( "first\n" );
		else printf( "second\n" );
	}
return 0;
}


你可能感兴趣的:(Brave Game)