Created
March 14, 2018 21:01
-
-
Save pranet/4f6f1c7b9da82a0175f4a11d0ea155ce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from collections import Counter | |
| MOD, N = 10**9 + 7, 10**5 + 2 | |
| fact = [1] + [j for j in [1] for i in xrange(1, N) for j in [(j * i) % MOD]] | |
| n, d = raw_input(), Counter(map(int, raw_input().split())).most_common() | |
| print (reduce(lambda x, y: (x * fact[d[0][1]] * pow(fact[d[0][1] - y[1]], MOD - 2, MOD)) % MOD, d, 1) * pow(fact[d[0][1]], MOD - 2, MOD)) % MOD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/xennygrimmato/7df391c292f4068cd3bc4496cfe65826
Where is your god now? :D