| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
hash(代码)#include<iostream>
#include<cstdio>
#include<string.h>
#include<algorithm>
#include<cmath>
using namespace std;
const int maxn=12500000;
struct snow
{
int a[5];
}x;
short a[maxn*2+1];
int n,i,j,k,sum,tot=0;
int main()
{
for(i=0;i<5;++i)scanf("%d",&x.a[i]);
for(i=-50;i<=50;++i)
if(i!=0)for(j=-50;j<=50;++j)
if(j!=0)a[i*i*i*x.a[0]+j*j*j*x.a[1]+maxn]++;
for(i=-50;i<=50;++i)
if(i!=0)for(j=-50;j<=50;++j)
if(j!=0)for(k=-50;k<=50;++k)
if(k!=0)
{
sum=i*i*i*x.a[2]+j*j*j*x.a[3]+k*k*k*x.a[4];
if(sum<=12500000&&sum>=-12500000)
tot+=a[sum+maxn];
}
printf("%d\n",tot);
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator