CF1278F Cards】的更多相关文章

CF1278F Cards 首先我们知道,一次拿牌的概率是 $ P(i) = \frac 1 m $ ,同时权值是1,所以期望就是 $ \frac{1} m $,拿 $ n $ 次牌贡献是独立的,就是 $ \frac n m $. 但是我们要算的是 $ k $ 次方的期望,众所周知期望的二次方不等于二次方的期望.我们考虑 $ E $ 的意义,$ E $ 在这一次拿到 Joker 的 $ \frac 1 m $ 的概率下是 1 ,其他情况是0.则 $ E^2 $ 就是随机两次,这两次都是 1 的情…
洛谷题面传送门 u1s1 这个推式子其实挺套路的吧,可惜有一步没推出来看了题解 \[\begin{aligned} res&=\sum\limits_{i=0}^ni^k\dbinom{n}{i}(\dfrac{1}{m})^i(\dfrac{m-1}{m})^{n-i}\\ &=\sum\limits_{i=0}^n\sum\limits_{j=1}^k\begin{Bmatrix}k\\j\end{Bmatrix}i^{\underline{j}}\dbinom{n}{i}(\dfra…
因为垃圾电脑太卡了就重开了一个... 前传:多项式Ⅰ u1s1 我预感还会有Ⅲ 多项式基础操作: 例题: 26. CF438E The Child and Binary Tree 感觉这题作为第一题还蛮合适的( 首先我们设 \(f_i\) 为权值之和为 \(i\) 的符合要求的二叉树的个数. 显然可以枚举根节点的权值.左子树的权值之和进行转移. 也就是 \(f_i=\sum\limits_{x\in S}\sum\limits_{y=0}^{i-S}f_yf_{i-x-y}\) 如果我们记 \(…
题目链接:Cards 听说这道题是染色问题的入门题,于是就去学了一下\(Bunside\)引理和\(P\acute{o}lya\)定理(其实还是没有懂),回来写这道题. 由于题目中保证"任意多次洗牌都可用这\(m\)种洗牌法中的一种代替",于是有了封闭性. 结合律显然成立. 题目中还保证了"对每种洗牌法,都存在一种洗牌法使得能回到原状态",逆元也有了. 只剩下一个单位元,我们手动补上.单位元就是不洗牌. 所以所有的洗牌方案构成了一个置换群.于是就可以用$Bunsid…
E. Vladik and cards time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vladik was bored on his way home and decided to play the following game. He took n cards and put them in a row in front…
1004: [HNOI2008]Cards Description 小春现在很清闲,面对书桌上的N张牌,他决定给每张染色,目前小春只有3种颜色:红色,蓝色,绿色.他询问Sun有 多少种染色方案,Sun很快就给出了答案.进一步,小春要求染出Sr张红色,Sb张蓝色,Sg张绝色.他又询问有多少种方 案,Sun想了一下,又给出了正确答案. 最后小春发明了M种不同的洗牌法,这里他又问Sun有多少种不同的染色方案. 两种染色方法相同当且仅当其中一种可以通过任意的洗牌法(即可以使用多种洗牌法,而每种方法可以使…
C. Hongcow Buys a Deck of Cards time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output One day, Hongcow goes to the store and sees a brand new deck of n special cards. Each individual card is eit…
题目链接: 传送门 Little Elephant and Cards time limit per test:2 second     memory limit per test:256 megabytes Description The Little Elephant loves to play with color cards. He has n cards, each has exactly two colors (the color of the front side and the…
题目链接: 传送门 Invitation Cards Time Limit: 5000MS     Memory Limit: 32768 K Description In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, mo…
E. George and Cards   George is a cat, so he loves playing very much. Vitaly put n cards in a row in front of George. Each card has one integer written on it. All cards had distinct numbers written on them. Let's number the cards from the left to the…