1 solutions
-
0
C++ :
#include<bits/stdc++.h> using namespace std; bool check(int x){ int y = sqrt(x); return y*y==x; } int main(){ int t; cin>>t; while(t--){ int n; cin>>n; int fl=0; for(int i=1;i*i<n;i++){ int j=n-i*i; if(check(j))fl=1; } if(fl)cout<<"Yes\n"; else cout<<"No\n"; } }
- 1
Information
- ID
- 34
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- 10
- Tags
- # Submissions
- 6
- Accepted
- 5
- Uploaded By