3 solutions
-
4
#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; }
- 1
Information
- ID
- 2179
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 1
- Tags
- # Submissions
- 79
- Accepted
- 25
- Uploaded By