
2 3 1 3 2
Case 1: first Case 2: second
/**************************************
***************************************
* Author:Tree *
*From :http://blog.csdn.net/lttree *
* Title : Coin Game *
*Source: hdu 3951 *
* Hint : 对称博弈 *
***************************************
**************************************/
#include <stdio.h>
int main()
{
int t,i,n,k;
scanf("%d",&t);
for( i=1;i<=t;++i )
{
scanf("%d%d",&n,&k);
printf("Case %d: ",i);
if( k==1 )
{
if( n&1 ) printf("first\n");
else printf("second\n");
}
else if( n<=k ) printf("first\n");
else printf("second\n");
}
return 0;
}ACM-对称博弈之Coin Game——hdu3951,布布扣,bubuko.com
原文:http://blog.csdn.net/lttree/article/details/24919099