| 记录编号 | 541680 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 159.[USACO Oct07] 完全平方数 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.005 s | ||
| 提交时间 | 2019-09-15 14:20:44 | 内存使用 | 13.66 MiB | ||
#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int n,x=0;
freopen("squares.in","r",stdin);
freopen("squares.out","w",stdout);
cin>>n;
if(n==0){
cout<<"500";
return 0;
}
for(int i=sqrt(n);i<=500;i++){
float m=sqrt(i*i-n);
int c=m/1;
if(m==c&&(i*i!=n)){
x++;
}
}
cout<<x;
}