T(1<=T<=10)
c(1<=c<=1e18)

3
4
18
30

yes
yes
no

# CODE

#include<string>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cmath>
#include<vector>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
#define LL long long
#define MOD 1000000007
#define MAXN 100050
{
LL w = 1, x = 0;
char ch = 0;
while (ch < '0' || ch>'9')
{
if (ch == '-')
w = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9')
{
x = x * 10 + (ch - '0');
ch = getchar();
}
return w * x;
}
LL n, m, cnt, t, prime[1000005],p[1000005];//prime记录素数
bool v[1000005];//记录是否是合数
int main()
{
n = 1000005;
v[0] = 1;//0不是素数
v[1] = 1;//1不是素数
for (register int i = 2; i <= n; i++)
{
if (!v[i])//如果i是素数 用prime记录，prime里面的素数严格递增
{
prime[++cnt] = i;
}
for (register int j = 1; j <= cnt; j++)//遍历所有素数
{
if (prime[j] * i > n)
{
break;
}
v[prime[j] * i] = 1;
if (i % prime[j] == 0)//如果该数（i）大于等于这个数的最小质因子，就跳出
//详见 https://www.cnblogs.com/jason2003/p/9761296.html 解释
{
break;
}
}
}
for (register int i = 1; i <= cnt; i++)
{
p[i] = prime[i] * prime[i];
}
while (t--)
{
LL nn = n;
bool ok = 1;
for (register int i = 1; i <= cnt; i++)
{
if (n % p[i] == 0)
{
ok = 0;
cout << "yes" << endl;
break;
}
if (nn % prime[i] == 0)
{
nn /= prime[i];
}
}
if (ok)
{
LL ss = sqrt(nn);
if (ss * ss == nn&&nn!=1)
{
cout << "yes" << endl;
}
else
{
cout << "no" << endl;
}
}
}
return 0;
}

06-08

06-15 2177