hdu 2601 An easy problem

/*


此题就是把公式变型,N=i*i +j*j+i*j=(i+1)(j+1)-1,即N+1=(i+1)(j+1)

即求N+1有几对因数;即需求sqrt(N+1)前面有几个因数:


*/

#include <stdio.h>
#include <math.h>
int main()
{
	__int64 n, temp;
	int i, t, c;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%I64d",&n), n++;  /*n的范围很大*/
		temp = sqrt((double)n);
		for(i=2,c=0; i<=temp; i++)
		{
			if(n%i == 0) c++;
		}
		printf("%d\n",c);
	}
	return 0;
}


原文地址:https://www.cnblogs.com/yyf573462811/p/6365363.html