Here is my first and second solution for this problem.
The only difference in these two solution is, former have an array ifact[3000000] (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 grepifact first.c
ull ifact[3000000];
//ifact[0] = 1;
//ifact[i] = mod(ifact[i-1]*ppow(i,m-2));
Below is result of diff command on these two file :-
8,9d7
ull fact[3000005];
ull ifact[3000000];
11a10
ull fact[3000005];
59d57
//ifact[0] = 1;
63d60
//ifact[i] = mod(ifact[i-1]*ppow(i,m-2));