The only difference in these two solution is, former have an array ifact (which i didn’t use) and later don’t.
First code has nothing to do with this ifact array, i just merely declared it, so to reduce memory i removed ifact from second one. But my first solution got accepted and second got runtime error
please tell me what is wrong with second code, i have no idea
result of grep ifact first.c
//ifact = 1; //ifact[i] = mod(ifact[i-1]*ppow(i,m-2));
Below is result of diff command on these two file :-
//ifact = 1;
//ifact[i] = mod(ifact[i-1]*ppow(i,m-2));