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

Array rearrangement

Time limit: 1000 ms
Memory limit: 256 MB
Given an array $A$ of $n$ integers. Count the number of different arrays can be obtained by rearranging elements in $A$. ### Input - The first line contains an integer $n$. - The second line contains $n$ integers $A_i$. ### Output - Print the number of different arrays, modulo $10^9+7$.. ### Constraints - $1 \le n \le 10^6$. - $1 \le A_i \le 10^9$. ### Example Input: ``` 4 1 2 1 3 ``` Output: ``` 12 ```
Introduction to combinatorics
Binomial coefficient
Fork and knife
Binomial coefficient 2
Equation
Array rearrangement
Value of subsequences
Inequation
Growing mushrooms
Binary matrix
Broken board
Triangles counting
Minecraft graph
Restricted path
Heavenly Peach Garden
Topic
Combinatorics
Rating 1300
Solution (1) Solution