开了ull WA on test 15
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int mod=998244353, N=505;
map<ll, ll>num;
ll n, x[N*N], a[N], b[N], cnt, p[N*N], cntt, ncnt, used[N], ans=1;
ll checkp3(ll x) {
ll l=0, r=2e6+5;
while(l+1<r) {
ll mid=l+r>>1;
if(mid*mid*mid<=x) l=mid;
else r=mid;
}
if(l*l*l==x) return l;
else return -1;
}
int main() {
scanf("%lld", &n);
for(ll i=1; i<=n; i++) {
scanf("%lld", &x[i]);
ll fc=sqrt(x[i]), fc3=checkp3(x[i]);
if(fc*fc!=x[i]&&fc3==(ll)-1) {
a[++cnt]=x[i];
}
else {
if(fc*fc==x[i]) {
ll fc4=sqrt(fc);
if(fc4*fc4==fc) {
num[fc4]+=4;
}
else num[fc]+=2;
}
if(fc3!=(ll)-1) {
num[fc3]+=3;
}
}
}
sort(a+1, a+1+cnt);
for(int i=1; i<=cnt; i++) {
if(a[i]!=a[i-1]) {
ncnt++;
used[ncnt]=2;
a[ncnt]=a[i];
b[ncnt]++;
}
else b[ncnt]++;
}
sort(x+1, x+1+n);
int len=unique(x+1, x+1+n)-x-1;
for(int i=1; i<=len; i++) {
for(int j=i+1; j<=len; j++) {
ll gc=__gcd(x[i], x[j]);
if(gc!=1) p[++cntt]=gc;
}
}
sort(p+1, p+1+cntt);
cntt=unique(p+1, p+1+cntt)-p-1;
for(int i=1; i<=ncnt; i++) {
for(int j=1; j<=cntt; j++) {
if(a[i]%p[j]==0) {
num[p[j]]+=b[i];
used[i]--;
}
}
}
for(auto v:num) {
// cout<<v.first<<" "<<v.second<<endl;
ans=ans*(v.second+1)%mod;
}
for(int i=1; i<=ncnt; i++) {
if(used[i]==2) ans=ans*(b[i]+1)%mod*(b[i]+1)%mod;
if(used[i]==1) ans=ans*(b[i]+1)%mod;
}
printf("%lld", ans);
return 0;
}