Problem: https://www.spoj.com/problems/TDPRIMES/
Code: https://ide.codingblocks.com/s/79508
My code is taking 3+ second, the time limit is about 1 second.
Any resource would be helpful.
Thanks!
Problem: https://www.spoj.com/problems/TDPRIMES/
Code: https://ide.codingblocks.com/s/79508
My code is taking 3+ second, the time limit is about 1 second.
Any resource would be helpful.
Thanks!
AC 1.32s
Are you considering 1 is not prime and 0 as prime in the pr array?
use bool array
thats quite fast
it is giving output.
you dont have to initialise bool array to true , we can do otherwise too.
just save time . dont do extra things which are not required
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.