| 记录编号 | 50813 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 159.[USACO Oct07] 完全平方数 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.004 s | ||
| 提交时间 | 2012-12-01 22:20:57 | 内存使用 | 0.32 MiB | ||
#include<fstream>
using namespace std;
ifstream fi("squares.in");
ofstream fo("squares.out");
int main()
{
int ans,a,b,n;
fi>>n;
ans=0;
a=1;
while((a-1)*2+1<=n)
{
for(b=1;b<n;b++)
{
if(a*a-b*b==n)
{
ans++;
}
}
a++;
}
fo<<ans;
return 0;
}