Factorial problem in maths section

https://ide.codingblocks.com/s/207086 My code is not working for all the test cases. May I know my mistake please?

@nayakashutosh99
if(p[k]==1)
a.push_back(k);
This line is troublesome and giving segmentation fault
Range of K is 10^8
p has a range of 10^7

that’s fine but after updating also I am getting WA in the last test case

@nayakashutosh99
Your answer is wrong for just this test case

Q: 1
40335377 61296961
A: 136267

Okay I will rectify it. Thank you

1 Like