摘要: 传送门:http://poj.org/problem?id=2096 【题解】 看到有人在uoj群上问这个……就去看了看… 顺便复习下概率dp $f_{i,j}$表示这个人已经找出了$i$种系统的bug,和$j$种bug的期望步数。 每次有4种转移: 1. 发现了新的bug种类,属于新的系统,那么是 阅读全文
posted @ 2017-07-15 21:00 Galaxies 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3083 【题解】 树链剖分,然后换根+询问子树这个是经典套路,分类讨论即可。 复杂度$O(nlog^2n)$ # include <stdio.h> # include <string.h> # 阅读全文
posted @ 2017-07-15 19:57 Galaxies 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3524 http://www.lydsy.com/JudgeOnline/problem.php?id=2223 【题解】 由于出现次数超过区间长度的一半的数最多只有1个,所以就可以分两半找了。 阅读全文
posted @ 2017-07-15 17:50 Galaxies 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://uoj.ac/problem/311 【题解】 这题的期望dp好神奇啊(可能是我太菜了) 由于每个位置都完全一样,所以我们设$f_{i,j}$表示审了连续$i$个位置,最大值不超过$j$的期望。 那么只要考虑最大值为$j$的期望,其他从$f_{i,j-1}$加进来即可。 枚举最 阅读全文
posted @ 2017-07-15 15:20 Galaxies 阅读(413) 评论(0) 推荐(0) 编辑
摘要: 马上就要noi了……可能滚粗已经稳了……但是还是要复习模板啊 LCT: bzoj2049 1A 7min # include <stdio.h> # include <string.h> # include <iostream> # include <algorithm> // # include 阅读全文
posted @ 2017-07-15 08:45 Galaxies 阅读(266) 评论(0) 推荐(0) 编辑