the outer loop that traverses over odd number ,shouldn’t that loop run just square root of n times.?
Optimisation in prime sieves
yes you can run that loop till root(n) and also the inner loop can be started with j=square(i)
thanks sir.
Also i’ll be glad if you could tell if there is something wrong with hackerblocks now adays, sometimes it wouldn’t give me full scores or show WA even if the same code gets accepted on spoj.
there may be few issues with the test cases, you can tell us whenever you face a problem. it will be fixed.
see if you are 200% confident on your solution then move on to another question, becasuse if you cant score a 100 then others can’t too.