随笔分类 -  数学-组合-计数类

摘要:题目链接 题目 给定一个多项式 (by+ax)k,请求出多项式展开后 xn×ym 项的系数。 思路 根据二项式定理 (a+b)k=i=0kCkiaibki 我们可以把原式变为: \((ax+by)^k=\sum_{i=0} 阅读全文
posted @ 2022-01-07 11:53 zhangtingxi 阅读(237) 评论(0) 推荐(0) 编辑
摘要:题目 Bessie the cow is trying to walk from her favorite pasture back to her barn. The pasture and farm are on an N×N grid (2≤N≤50 ), with her pasture in 阅读全文
posted @ 2021-12-21 17:51 zhangtingxi 阅读(687) 评论(2) 推荐(0) 编辑
摘要:组合数学的推式子题公式基本上都有了 i=0nCni=2n i=0nCni(1)i=0 i=0nCnixi=(1+x)n \(\Large C_n^kC_k^i=C_n^i 阅读全文
posted @ 2021-12-14 22:03 zhangtingxi 阅读(371) 评论(0) 推荐(0) 编辑
摘要:题目链接 由于BZOJ已挂,这里是黑暗爆炸和hydro的备份 黑暗爆炸: 国王奇遇记 国王奇遇记加强版 hydro: 国王奇遇记 国王奇遇记加强版 题目 Katharon 国有着悠久的历史,每个慕名而来的游客都渴望能在 Katharon 国发现一些奇怪的宝藏。而作为国王的 Kanari 君也梦想着有 阅读全文
posted @ 2021-12-14 18:44 zhangtingxi 阅读(232) 评论(0) 推荐(0) 编辑
摘要:(a+b)n=k=0nCnkakbnk 在化简一些式子时有用 因此,2n (也就是当 a=b=1 )时也可以表示为: 2n=k=0nCnkakbnk 然而后面这个公式我也不知 阅读全文
posted @ 2021-12-14 17:23 zhangtingxi 阅读(189) 评论(0) 推荐(0) 编辑
摘要:题目链接 题目 You are given a sequence of numbers a1, a2, ..., an, and a number m. Check if it is possible to choose a non-empty subsequence aij such that t 阅读全文
posted @ 2021-12-08 22:36 zhangtingxi 阅读(341) 评论(0) 推荐(0) 编辑
摘要:题目链接 题目 Define the distance between two strings of the same length as the numbers of the positions where the characters differ in these two strings. I 阅读全文
posted @ 2021-12-08 19:01 zhangtingxi 阅读(50) 评论(0) 推荐(0) 编辑
摘要:题目链接 题目 Your company has just constructed a new skyscraper, but you just noticed a terrible problem: there is only space to put one game room on each 阅读全文
posted @ 2021-12-08 18:13 zhangtingxi 阅读(392) 评论(0) 推荐(0) 编辑
摘要:题目链接 题目 There is a n×m board, a chess want to go to the position (n,m) from the position (1,1). The chess is able to go to position (x2,y2) from the p 阅读全文
posted @ 2021-12-07 22:33 zhangtingxi 阅读(27) 评论(0) 推荐(0) 编辑
摘要:Lacus 求: Cmn mod p 则: Cmn mod p=Cmpnp×Cm mod pn mod p mod p 由于 \(C_{m~mod~p}^{n~mod~p} 阅读全文
posted @ 2021-12-07 17:47 zhangtingxi 阅读(48) 评论(0) 推荐(0) 编辑
摘要:题目链接 我们先对于有向图缩点,变成一棵树。 然后我们对于每个树上且在原图中的分割点节点所对应原图中的连通块考虑。 假设这里没有割点,很明显,只需要放2个出口即可。 如果有一个割点,说明这个点是树上的叶子节点,需要放1个出口。 如果有两个或以上的割点,无论哪个割点被割,都可以往另一个方向逃,所以这个 阅读全文
posted @ 2021-12-01 18:39 zhangtingxi 阅读(120) 评论(0) 推荐(0) 编辑
摘要:题目链接 首先这个点删去之后必然与剩下 n1 个点失去相连。 如果这个点能使其它点失去相连,说明这个点为割点。 然后统计一下每个儿子与父亲的影响即可。 Code // Problem: #10104. 「一本通 3.6 练习 5」Blockade // Contest: LibreOJ / 阅读全文
posted @ 2021-12-01 17:23 zhangtingxi 阅读(79) 评论(0) 推荐(0) 编辑
摘要:题目链接 看题,发现是一个缩点。 缩完点后,对于每一个强连通分量,取其汽油费的最小值,最小值的和就是答案。 方案就是每个强连通分量最小值个数相乘。 Code // Problem: P2194 HXY烧情侣 // Contest: Luogu // URL: https://www.luogu.co 阅读全文
posted @ 2021-11-27 19:01 zhangtingxi 阅读(33) 评论(0) 推荐(0) 编辑
摘要:题目链接 首先dp得从低位向高位枚举,因为高位无论如果使用 2ai 都对低位二进制1的个数无影响,满足dp的无后效性。 设 dp(k,i,x,y)S 从低的高二进制的前 k 位中,用了数列 a 的前 i 项,且此时 S 中共 阅读全文
posted @ 2021-11-22 21:21 zhangtingxi 阅读(387) 评论(0) 推荐(0) 编辑
摘要:题目链接 首先第一问很好求,就是求最长下降子序列,n5000O(n2) 暴力转移就行。 而这道题的难点就在于去重。 对于 iji>j),如果 ai=ajdpi=dpj,说明他们是相同的,i 阅读全文
posted @ 2021-11-21 19:06 zhangtingxi 阅读(39) 评论(0) 推荐(0) 编辑
摘要:题目链接 设 dp(i,j) 为前 i 行放 j 个棋子的方案数, leni 为第 i 行的列数。 类似背包的思想,每一行放或不放: dp(i,j)=dp(i1,j)+dp(i1,j1)×(leni(j1)) \(dp( 阅读全文
posted @ 2021-11-15 21:38 zhangtingxi 阅读(82) 评论(0) 推荐(0) 编辑
摘要:卡特兰数 博客园的 LATEX 好容易炸啊 设 f(1)=1,则 : f(n)=i=0n1(f(i)×f(ni1)) 当然,也有两个通用公式: $$f(n)=\frac{C_{2n}^n}{n+1}$$ \(f(n)=C_{2n}^n 阅读全文
posted @ 2021-11-14 14:42 zhangtingxi 阅读(48) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示