report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Segmented sieve - MarisaOJ: Marisa Online Judge

Segmented sieve

Time limit: 1000 ms
Memory limit: 256 MB
Given an 2 integers $L, R$. Find all primes in range $[L, R]$. ### Input - The first line contains 2 integers $L, R$. ### Output - Print all primes in range $[L, R]$ in ascending order. ### Constraints - $1 \le L \le R \le 10^{12}$. - $1 \le R - L + 1 \le 10^6$. ### Example Input: ``` 20 30 ``` Output: ``` 23 29 ```
Basic number theory
Prime number 2
Sieve of Eratosthenes
Segmented sieve
Prime factors
Maximum GCD
Divisors counting
Largest common divisor
Nearest Element
Divisors counting 2
GCD and LCM
GGCD
Square root sum
Square number
Sum sum sum
Topic
Math
Rating 800
Solution (1) Solution