DWITE '09 R7 #2 - Sum of Primes

View as PDF

Submit solution

Points: 7
Time limit: 1.0s
Memory limit: 64M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
DWITE Online Computer Programming Contest, May 2010, Problem 2

Lets keep this simple.

The input will contain 5 lines, integers 2 \leq N \leq 100\,000

The output will contain 5 lines, integer sums of all prime numbers up to (inclusive) N.

Sample Input

2
3
4
5
100000

Sample Output

2
5
5
10
454396537

Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) Problem Resource: DWITE


Comments


  • -6
    jaydenchu2003  commented on Feb. 1, 2020, 11:20 p.m.

    This comment is hidden due to too much negative feedback. Click here to view it.