2 solutions
-
1
- 1
Information
- ID
- 2179
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 8
- Tags
- # Submissions
- 26
- Accepted
- 5
- Uploaded By
#include<bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin>>T;
while(T--)
{
int a;
cin>>a;
int cnt=0;
for(int x=1;x<=a/x;x++) //枚举第一个数
{
for(int y=1;y<=a/y;y++) //枚举第二个数
{
if(x*x+y*y==a)
{
cnt++;
}
}
}
if(cnt>0) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
}