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
sieve of eratosthenes gives AC in 0.93s (with printf)Last edit: 2015-02-17 14:18:38
sieve -> AC in 9.36,, Phew!
@ALL people who solved it in under 4 seconds. How?! A hint at least!
We can easily bring this under 1 sec, just lil coding needed.i wish the timelimit was under 2 seconds. Would have been much more fun.lazy i m .
optimized sieve+putchar_unlocked()->AC :)
@surayans tiwari IDEONE is using **CUBE** cluster and here SPOJ is using Pyramid cluster...CUBE id 20X faster than Pyramid.
running in 1.7 seconds on ideone and tle here please check my code
what is SIGKILL??
Gaurav Kumar Verma:
c++ AC, java TLE. :(
|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|