标签: 生成函数

  • 洛谷题库 P6031 Cards 加强版 – 题解与思路重现

    洛谷题库 P6031 Cards 加强版

    对于每一轮对局的 $m!$ 种排列,对于编号为 $a$ 的牌,恒有 $(m-1)!$ 种是以牌 $a$ 为首的。因此一轮可以归为 $m$ 种情况,首张为王牌的概率为 $\frac{1}{m}$。

    这是某场模拟考试给出的部分分:
    $$
    \begin{array}{cccc}
    \text{Subtask}&\text{Constraints}&\text{Points}&\text{Dependencies}\\ \hline
    1&n,m,k\leq 5&2&\\
    2&k=1&2&\\
    3&k\leq 5000&10&1,2\\
    4&m\leq 100&10&1\\
    5&n\leq k&5&\\
    6&k\leq 10^5&10&1,2,3\\
    7&k\leq 5\times 10^6&20&1,2,3,6\\
    8&&41&1\sim 7
    \end{array}
    $$ (更多…)