2019年1月16日

bzoj 2784 [JLOI2012]时间流逝——树上高斯消元

摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2784 一个状态可以加很多个能量圈,但减少能量圈的情况只有一种。所以可以用树来刻画。 然后就变成树上高斯消元的套路了。注意根节点的 P 等于 0 。 发现不是要求 dp[ 1 ] 就必须在那个式 阅读全文

posted @ 2019-01-16 23:43 Narh 阅读(212) 评论(0) 推荐(0) 编辑

LOJ 2542 「PKUWC2018」随机游走 ——树上高斯消元(期望DP)+最值反演+fmt

摘要: 题目:https://loj.ac/problem/2542 可以最值反演。注意 min 不是独立地算从根走到每个点的最小值,在点集里取 min ,而是整体来看,“从根开始走到点集中的任意一个点就停下”的期望步数。 设 f[ i ] 表示从根走到 i ,再走期望几步就能走到点集中的某个点。有 \( 阅读全文

posted @ 2019-01-16 22:01 Narh 阅读(295) 评论(0) 推荐(0) 编辑

poj 2096 Collecting Bugs && ZOJ 3329 One Person Game && hdu 4035 Maze——期望DP

摘要: poj 2096 题目:http://poj.org/problem?id=2096 f[ i ][ j ] 表示收集了 i 个 n 的那个、 j 个 s 的那个的期望步数。 #include<cstdio> #include<cstring> #include<algorithm> #define 阅读全文

posted @ 2019-01-16 18:16 Narh 阅读(157) 评论(0) 推荐(0) 编辑

LOJ 6485 LJJ 学二项式定理——单位根反演

摘要: 题目:https://loj.ac/problem/6485 \( \sum\limits_{k=0}^{3}\sum\limits_{i=0}^{n}C_{n}^{i}s^{i}a_{k}[4|(i-k)] \) 然后就是套路即可。 阅读全文

posted @ 2019-01-16 09:23 Narh 阅读(239) 评论(0) 推荐(0) 编辑

bzoj 3328 PYXFIB——单位根反演

摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3328 单位根反演主要就是有 \( [k|n] = \frac{1}{k}\sum\limits_{i=0}^{k-1}w_{k}^{i*n} \) 如果 k | n ,转 n 下就会是 1 ; 阅读全文

posted @ 2019-01-16 08:50 Narh 阅读(227) 评论(0) 推荐(0) 编辑

导航