#2 WA 求助
查看原帖
#2 WA 求助
712337
XYQ_102楼主2024/1/3 17:38
#include<bits/stdc++.h>
using namespace std;
bool isPS(int num) 
{
    int root=sqrt(num);
    return root*root==num;
}
int main()
{
	int T;
	cin>>T;
	while(T--)
	{
		long long n,f[200010];
		double cnt=0,s;
		cin>>n;
		for(int i=1;i<=n;i++)
		{
			cin>>f[i];
			cnt+=f[i];
		}
		if(isPS(cnt))
			cout<<"YES\n";
		else
			cout<<"NO\n";
	}
	return 0;
}

Wrong Answer.wrong answer expected NO, found YES [1st token]

2024/1/3 17:38
加载中...