| 记录编号 | 68715 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 160.[USACO Oct07] 贝茜的秘密牧场 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 2.590 s | ||
| 提交时间 | 2013-08-26 10:51:50 | 内存使用 | 0.31 MiB | ||
#include<fstream>
#include<cmath>
using namespace std;
ifstream fin("secpas.in");
ofstream fout("secpas.out");
int n,ans=0;
void dfs(int x,int a)
{
if(x==4&&a==n)
ans++;
else
{
if(x<4)
{
for(int i=0;i<=sqrt(double(n));i++)
dfs(x+1,a+i*i);
}
}
}
int main()
{
fin>>n;
dfs(0,0);
fout<<ans<<endl;
return 0;
}