标签:des style java color strong os
1 2 3 -4 1 1 1 1
39088 0
#include<stdio.h>
#include<algorithm>
#define M 2000004
int hash[M];
int main ()
{
int a,b,c,d;
int i,j;
int sum,s[101];
for(i=1;i<=100;i++)
s[i]=i*i;
while(~scanf("%d%d%d%d",&a,&b,&c,&d))
{
if((a>0&&b>0&&c>0&&d>0)||(a<0&&b<0&&c<0&&d<0))
{
printf("0\n");
continue;
}
sum=0;
memset(hash,0,sizeof(hash));
for(i=1;i<=100;i++)
for(j=1;j<=100;j++)
hash[a*s[i]+b*s[j]+M/2]++; // M/2 是防止下标为负数。
for(i=1;i<=100;i++)
for(j=1;j<=100;j++)
sum+=hash[-(c*s[i]+d*s[j])+M/2]; // 亏大神们想得出啊!
printf("%d\n",sum*16);
}
return 0;
}hdu 1469 Equations,布布扣,bubuko.com
标签:des style java color strong os
原文地址:http://blog.csdn.net/fyxz1314/article/details/37819765