zoj 3591 Nim

/*博弈NIM,注意最后统计的时候应该先将nim数组排序,然后统计nim[i]相同的个数,否则会tle*/
#include
#include
#include
using namespace std;
long long N = 0, S = 0, W = 0;
#define MAXN 1000000
long long a[MAXN],nim[MAXN];
void init()
{
	int g = S;
	for (int i = 0; i> testn;
	for (k = 0; k < testn; k++)
	{
		cin >> N >> S >> W;
		memset(a,0,sizeof(a));
		memset(nim, 0, sizeof(0));
		init();
		long long num = N*(N + 1) / 2;
		nim[0] = a[0];
		for ( i = 1; i 

你可能感兴趣的:(ZOJ_博弈)