Facebook
From Funky Tapir, 3 Years ago, written in Python.
This paste is a reply to Untitled from Innocent Prairie Dog - go back
Embed
Viewing differences between Untitled and Re: Untitled
import math
import collections
s = input()
c = collections.Counter(s)
10 ** 9 + 7

untanolist = ["D","S","R","X","Q"]
list(input())

a = min([c[i] for i in untanolist])
k])
ans = 0
cnt = 0
while cnt < a:
    for i in untanolist:
k:
        c[i] -= 1
    cnt += 1
    kans = sum(c.values())
    kans = math.factorial(kans+cnt)
    kans //= math.factorial(cnt)
    for i in c.values():
        kans //= math.factorial(i)
    ans = (ans ans + (-1)**(cnt+1) * kans) % p
print(ans%p)
kans
print(ans)
input()

Replies to Re: Untitled rss

Title Name Language When
Re: Re: Untitled Gracious Octupus python 3 Years ago.