Let $n$ be a positive integer, and let $(c_1, \ldots, c_n)$ be a sequence of integers such that $\sum_{i=1}^n ic_i = n$. Show that the number of permutations $\sigma \in S_n$ with exactly $c_i$ cycles of length $i$ for each $i$ is given by $$\frac{n!}{1^{c_1} c_1! 2^{c_2} c_2! \cdots n^{c_n} c_n!}$$
Here, I believe that the approach would be to define a surjection $f: S_n \to X$ and then show that it is surjective, and that $|f^{-1}(\sigma)| = 1^{c_1} c_1! 2^{c_2} c_2! \cdots n^{c_n} c_n!$ for any $\sigma \in X$.
However, I still confused and I don't know how to proceed.
Supposing our sequence $(c_1, c_2, \ldots, c_n)$ is such that $\sum_{q=1}^n q c_q = n$ with some $c_q$ possibly zero so that there are $c_q$ cycles of length $q$ we first have to select the values from $n$ that go on every cycle by a multinomial coefficient
$$\frac{n!}{\prod_{q=1}^n q!^{c_q}}$$
Now a set of $q$ values gives $q!/q$ cycles for a contribution of
$$\prod_{q=1}^n \frac{q!^{c_q}}{q^{c_q}}$$
and the ordering of the $c_q$ cycles of the same length does not matter, giving
$$\prod_{q=1}^n \frac{1}{c_q!}.$$
Collecting everything we find
$$\frac{n!}{\prod_{q=1}^n q!^{c_q}} \prod_{q=1}^n \frac{q!^{c_q}}{q^{c_q}} \prod_{q=1}^n \frac{1}{c_q!} = \frac{n!}{\prod_{q=1}^n c_q! q^{c_q}}$$
as claimed.