- 【GESP202406C++二级】平方之和
tj
- 2025-1-14 9:52:08 @
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,a;
cin>>n;
while(n--){
cin>>a;
bool flag=false;
for(int x=0;x*x<a;x++){
for(int y=x;y*y<a;y++){
if(x*x+y*y==a){
flag=true;
}
}
}
if(flag==true){
cout<<"Yes"<<endl;
}else{
cout<<"No"<<endl;
}
}
return 0;
}
0 comments
No comments so far...
Information
- ID
- 2551
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 8
- Tags
- # Submissions
- 63
- Accepted
- 12
- Uploaded By