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

GCD Subsets

Time limit: 1000 ms
Memory limit: 256 MB
Given a $n$ elements array $A_1,A_2,...,A_n$.Calculate: $$\prod gcd(S)$$ with $S$ are non-empty subsets of given array$A$. ### Input - The first line contains integer $n$. - The second line contains $n$ integers $A_i$. ### Output - Print the answer, modulo $10^9+7$. ### Constraints - $1 \le n \le 10^5.$ - $1 \le A_1,A_2,...,A_n \le 10^6.$ ### Example Input: ``` 4 2 3 1 6 ``` Output: ``` 216 ```
Number theory
The 666-th problem
Sum of remainders
Fibonacci 3
GCD Subsets
Topic
Math
Rating 2000
Source ICPC
Solution (1) Solution