here is my code https://ide.codingblocks.com/s/265454
pls tell me where did i go wrong
WA on all test cases except tc 0
What is your approach? Are you first calculating the number n whose prime factors are given?
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
I can’t really figure out the combination and permutation thing in here, please tell me how many times will a prime number appear in P(multiplication of all divisors)
Hello @sshreya2912, Here I need to take the mod while dividing and for that, we need to implement modulo inverse. And here 10^9+7 is prime no. and for prime nos. we can find out the modulo using Fermat’s theorem and it says if there is a no. let’s n and a prime no. p then,
(n^(p-1))%p == 1 considering n is not divisible by p.
And if I need to calculate (1/n)%p == (n^(p-2))%p and
that’s why I am using mod-2 as power if the mod is my prime no.
Pls refer this and ask if you face any problem.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.