Primes... again
Given two integers N and M (N ≤ M), output all the prime numbers between N and M inclusive, one per line.N and M will be positive integers less than or equal to 1,000,000,000.
The difference between N and M will be less than or equal to 5,000,000.
Sample Input
5 20
Sample Output
5 7 11 13 17 19
All Submissions
Best Solutions
Point Value: 15 (partial)
Time Limit: 5.00s
Memory Limit: 32M
Added: Oct 18, 2008
Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3
Comments (Search)
I sumbitted A+B(2) like 40 times -_-
The more you are used to a certain level, the easier it is to do the questions of that level.
I know people who thought they are only capable of doing 3pt questions, the 5pt questions were hard and would take a long long time. They thought it was rigged but after a while, they did more and more 5pts and they got used to it. Now as they think back, the 5pt, weren't so hard after all. Same applies for 10pt. Same applies to this.
995 000 000
1 000 000 000
:P