1 solutions

  • 0
    @ 2025-11-27 11:55:05

    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
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By