Why it is giving RE


here is my code
similarly in the deepak and prime ques I m getting RE for 1000005 but if I change it to 10000 then it is working fine but it gives WA for some of the test cases

I have edited your code … Try to submit it now…