【巴什博弈】杭电 hdu 1846 Brave Game


/* THE PROGRAM IS MADE BY PYY */
/*----------------------------------------------------------------------------//
    Copyright (c) 2012 panyanyany All rights reserved.

    URL   : http://acm.hdu.edu.cn/showproblem.php?pid=1846
    Name  : 1846 Brave Game

    Date  : Sunday, March 4, 2012
    Time Stage : half an hour

    Result:
5463555	2012-03-04 10:46:05	Accepted	1846
0MS	216K	1030 B
C++	pyy

5463546	2012-03-04 10:45:10	Output Limit Exceeded	1846
140MS	188K	1043 B
C++	pyy

5463515	2012-03-04 10:42:43	Wrong Answer	1846
0MS	216K	1043 B
C++	pyy


Test Data :

Review :
while (scanf(“%d”, &tcase) != EOF)是会WA的。
while (scanf(“%d”, &tcase) , tcase)是会OLE的。
//----------------------------------------------------------------------------*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>

#include <algorithm>
#include <iostream>

using namespace std ;

#define MEM(a, v)		memset (a, v, sizeof (a))	// a for address, v for value
#define max(x, y)		((x) > (y) ? (x) : (y))
#define min(x, y)		((x) < (y) ? (x) : (y))

#define INF		(0x3f3f3f3f)
#define MAXN	(15)
#define MAXE	(MAXN*MAXN)

#define DB	/##/
#define LL __int64

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


你可能感兴趣的:(【巴什博弈】杭电 hdu 1846 Brave Game)