TDPRIMES - Printing some primes
The problem statement is really simple. You are to write all primes less than 10^8
Input
There is no input.
Output
To make the problem less output related write out only the 1st, 101st, 201st, ... 1st mod 100.
Example
Input: Output: 2 547 1229 ... 99995257 99996931 99998953
hide comments
Abel Nieto Rodriguez:
2010-06-04 14:46:14
@Alfonso2
|
|
sudipto das:
2010-05-21 11:22:27
Modular arithmatics can help to make Sieve of Eratosthenes more fast & get AC from TLE............ |
|
যোবায়ের:
2010-04-17 07:05:32
Damn! I didn't know that unsigned is slow :( |
|
numerix:
2011-02-08 12:46:28
Could you please open it for Python.
|
|
jean caffou:
2010-04-17 07:05:32
I am testing on a very limited virtual machine...
|
|
numerix:
2010-04-17 07:05:32
There's nothing strange about that. SPOJ uses very slow machines. |
|
jean caffou:
2010-04-17 07:05:32
My program also executes in 5secs, but I get TLE on SPOJ (time limit here is 10s) strange.. |
|
pankaj:
2010-04-17 07:05:32
after lots of optimization it went to 2.8 now i don't know how to optimize more
|
|
pankaj:
2010-04-17 07:05:32
my program giving output in 2.99 sec in my sys :( TLE here |
|
hosam samy:
2010-04-17 07:05:32
the program takes 4 or 5 seconds in my PC and i got TLE :| |
Added by: | Alfonso² Peterssen |
Date: | 2010-04-06 |
Time limit: | 1.325s |
Source limit: | 10000B |
Memory limit: | 1536MB |
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 guile SCM qobi ST SQLITE TCL WHITESPACE |
Resource: | Thanks to TDuke |