Factorial code not accepted by codechef

submission link:

Your Code is almost correct just one mistake is there that is you have not putted blocks { } in Last for loop and also remove " const" in the first line of main()…
So here is your corrected code:-

int main()
int t;
int i,c;
int n[t-1],f[t-1];
return 0;}

Just look at constraints. Especially this one 1 <= n <= 100

Just imagine 10^2 \times (9.9)10 \times (9.8)10 \times (9.7)10 \times (9.6)10 \times (9.5)10 \times (9.4)10 ....

This makes something even greater than 10^{100} but do you remember the range of an integer (even taking 64 bit unsigned one) is 2^{64} -1 that is roughly nearly equal to 10^{19}(upper bound not lower)

So your integer overflows, and tada its a wrong answer.

Give this a read.

Please give your submission link here instead of code, and modify title and description of question to something meaningful

I would suggest you to first search these stuffs on google,see through others code,check where your code mismatches,see if anyone else had the same problem,if u still cant get it done,then ask it on the discuss,as i think these question’s solutions and common errors are easily available on google.

1 Like

Thnks everyone