Given some numbers, can you tell, if the product of these numbers are a perfect square or not? A num…
Click here to read the complete problem statement.
If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.
#include<stdio.h>
int main()
{
long long int T,i,n,j,l;
scanf(“%lld”,&T);
for(i=1; i<=T; i++){
scanf("%lld",&n);
long long int m=1,h;
double k,l;
for(j=1; j<=n; j++){
scanf("%lld",&h);
m=m*h;
}
k=sqrt(m);
l=m-(k*k);
if(l==0){
printf("YES\n");
}
else{
printf("NO\n");
}
}
}
After running it,with the sample cases my compiler says YES NO NO but toph says YES NO YES.How is it possible ??? Plz, hlp.
Matha gorom hoye jacche. Continuously 4 days I have noticed that kind of problem in different kinds of problems in toph.co