70分求助
查看原帖
70分求助
1165146
Linco2012楼主2024/7/25 17:21
#include<iostream>
#include<cmath>
#include<cstring>
#include<ctime>
#include<algorithm>
#include<queue>
#include<list>
#include<set>
#include<map>
#include<stack>
using namespace std;
int main()
{
	long long t;
	cin>>t;
	while(t--)
	{
		long long n;
		cin>>n;
		bool f=1;
		for(int x=1;x*x<n;x++)
		{
			int y=sqrt(n-(x*x));
			if(x*x+y*y==n&&y!=0)
			{
				cout<<"Yes\n";
				f=0;
				break;
			}
		}
		if(f)    cout<<"No\n";
	}
	return 0;
}

#5,#7,#8错了

2024/7/25 17:21
加载中...