Did not work!!!
Thanks, It's my mistake for upload file. Now, you can check this code (Ac) :)
Logicwise, in the loop inside sod function,the condition must be like:i<prime.size() and prime[i]*prime[i]<n(not i*i<n)
It's not a major Issue. You can solve this problem in many way :) Your logic is almost correct.
what if number is greater than 1e8 how it will work??
I think that if the number doesn't have any prime divisor less than 1e8then it must be a prime less than or equal 1e16 and it will be handeled in the if(n>1) condition.
If you have any doubts, Please let me know
6 Comments
Did not work!!!
ReplyDeleteThanks, It's my mistake for upload file. Now, you can check this code (Ac) :)
DeleteLogicwise, in the loop inside sod function,the condition must be like:
ReplyDeletei<prime.size() and prime[i]*prime[i]<n(not i*i<n)
It's not a major Issue. You can solve this problem in many way :) Your logic is almost correct.
Deletewhat if number is greater than 1e8 how it will work??
ReplyDeleteI think that if the number doesn't have any prime divisor less than 1e8
Deletethen it must be a prime less than or equal 1e16 and it will be handeled in the if(n>1) condition.
If you have any doubts, Please let me know