TDPRIMES - Printing some primes
The problem statement is really simple. You are to write all primes less than 10^8
There is not input
To make the problem less output related write out only the 1st, 101st, 201st, ... 1st mod 100.
Input: Output: 2 547 1229 ... 99995257 99996931 99998953
what? same exact code gave TLE yesterday and AC today :O
i have took 0.79 !
How did they do it within 0.1s? mine took 0.44s!Last edit: 2016-03-15 20:42:19
Um getting RE .. but why ?? I have used Bit wise sieve .
If you want to apply simple sieve with no optimization then use the Output Given Wisely !!!!!!!!!!!!!!!!
took 0.64s how to optimize further as there are many ac solutions below 0.5 sLast edit: 2015-07-08 09:00:20
Accepted at 0.46 second
Runtime on Ideone.... but, AC in spoj
Optimised sieve AC in one go.... :
|Added by:||Alfonso² Peterssen|
|Cluster:||Cube (Intel G860)|
|Languages:||All except: ASM32 ASM64 BF CLPS LISP sbcl LISP clisp ERL HASK ICON ICK JS-RHINO LUA NEM NICE OBJC OCAML PHP PIKE PRLG-swi SCALA SCM qobi SCM guile ST SQLITE TCL WHITESPACE|
|Resource:||Thanks to TDuke|