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

Prime factors

Time limit: 2000 ms
Memory limit: 256 MB
Given $q$ queries, each is an integer $n$, find all prime factors of $n$. ### Input - The first line contains an integer $q$. - The next $q$ line, each line contains an integer $n$. ### Output - Print $q$ lines, $i^{th}$ line contains every prime factors of $i^{th}$ query in ascending order. ### Constraints - $1 \le q \le 5 \times 10^5$. - $2 \le n \le 10^6$. ### Example Input: ``` 2 9 24 ``` Output: ``` 3 2 3 ```
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 1000
Solution (1) Solution