in this question how to tackle with number 10^12 and how to check the ans?
give a hint of overall question how to do it?
T-prime question
@harry_potter123 The value of n here is 5*10^5. So at max you need to traverse 10^8 times in seive. And make sure you create a vector not an array.
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.
this is my code it is giving tle why
@harry_potter123 Use ceil and floor functions. You are again and again computing your sqrt(). Otherwise your logic is correct.
You can have a look at this code for reference: