Sir, I am getting segmentation fault again and again in this program.
Segmentation fault in T-Prime problem
@Shamikh07 in the question the value of x can be upto 10^12 so your solution is not optimal think like if a number is perfect square then it is going to have odd number of divisors and if we that that divisors must be equal to 3 then the sqrt(number) must be a prime number simply check these 2 conditions and handle some corner cases like number=1 and we are done
if dout still exists let me know and if clear mark my experience
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.