Submit | All submissions | Best solutions | Back to list |
TDPRIMES - Printing some primes |
The problem statement is really simple. You are to write all primes less than 108.
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
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 |
hide comments
|
||||||||||||||
2019-06-29 20:26:46
AC in one go :) used a customized sieve. |
||||||||||||||
2019-06-07 19:59:47
Very tight constrains... I used bool array instead of int array and got AC... |
||||||||||||||
2019-06-07 19:46:20
Used sieves... Still getting TLE, takes 4+ seconds. People are using bitwise operator, why? Aren't they only used to decrease space? @ilovegianghsgs @shaakal |
||||||||||||||
2019-05-24 11:25:53
i doneit compiler is slow but spoj compiler will accept >>bitwise sieve |
||||||||||||||
2018-12-25 21:41:00 Daniel Papp
1st mod 100 apparently means i % 100 == 0 |
||||||||||||||
2018-12-24 11:52:54
1st, 101st, 201st, ... 1st mod 100 Can any codehelper explain the meaning of the above what is 1st mod 100 I dont understand what to display Last edit: 2018-12-24 12:01:07 |
||||||||||||||
2018-12-19 16:58:45
0.6s.Accepted In Second Go !!! |
||||||||||||||
2017-10-03 20:37:26
Segmented sieve it is!! Also learnt about memset(a, b, c) function. Last edit: 2017-10-03 20:38:18 |
||||||||||||||
2017-08-31 16:11:30
0.22 sec AC in one go |
||||||||||||||
2017-08-05 05:10:38
AC in 0.24s using bitwise sieve, in 0.46s with classic sieve using bitset |