救救孩子吧,30分,不过没有TLE
查看原帖
救救孩子吧,30分,不过没有TLE
780187
ruananbo楼主2025/2/5 16:15
#include<bits/stdc++.h>
using namespace std;
int main() {   
    int a,c=0;
    long long b;
    cin>>a;
    for(int i=1;i<=a;i++){
        cin>>b;
        for(int j=1;j<=a;j++){
            for(int k=1;k<=a;k++){
                if(k*k+j*j==b){
                    c++;}}}
        if(c>=1){
            cout<<"Yes"<<endl;}
        else{
            cout<<"No"<<endl;}
        c=0;}

    

	return 0;
}
2025/2/5 16:15
加载中...