会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
逢山开路 遇水架桥
尽人事,听天命。
博客园
首页
新随笔
联系
管理
订阅
上一页
1
2
3
4
5
6
···
26
下一页
2017年7月18日
hihocoder1415 后缀数组三·重复旋律3
摘要: 传送门:http://hihocoder.com/problemset/problem/1415 【题解】 考虑求出两串合在一起(中间加分隔符)后缀数组,就是要求任意在两个串中的$i, j$,$\min\{h_k\} (i \leq k \leq j)$的最大值。 考虑$i, j$一定是满足$|i
阅读全文
posted @ 2017-07-18 06:46 Galaxies
阅读(235)
评论(0)
推荐(0)
2017年7月17日
bzoj3172 [Tjoi2013]单词
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3172 【题解】 考虑建出AC自动机,那么fail树上每个点的父亲为fail,父亲->儿子为后缀关系(父亲是儿子后缀) 那么走到父亲肯定走到了儿子,直接统计即可。 # include <queu
阅读全文
posted @ 2017-07-17 22:41 Galaxies
阅读(266)
评论(0)
推荐(0)
bzoj1430 小猴打架
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1430 【题解】 考虑带标号无根树计数,总共是$n^{n-2}$种。 考虑顺序问题,一共是$(n-1)!$种,所以答案是$n^{n-2} * (n-1)!$。 复杂度$O(n)$ # inclu
阅读全文
posted @ 2017-07-17 21:48 Galaxies
阅读(231)
评论(0)
推荐(0)
2017年7月16日
bzoj2038 [2009国家集训队]小Z的袜子(hose)
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=2038 【题解】 莫队出的裸莫队。 # include <math.h> # include <stdio.h> # include <string.h> # include <iostream
阅读全文
posted @ 2017-07-16 15:16 Galaxies
阅读(285)
评论(0)
推荐(0)
bzoj2844 albus就是要第一个出场
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=2844 【题解】 考虑$n$个数组成的基,大小为$k$,那么每种方案都有$2^{n-k}$可以取到。 观察样例也能发现这个结论。 然后就是正常的线性基统计,最后乘一个$2^{n-k}$,加一即可
阅读全文
posted @ 2017-07-16 15:02 Galaxies
阅读(235)
评论(0)
推荐(0)
bzoj3224 Tyvj 1728 普通平衡树
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3224 【题解】 写起来跟*一样,但是还是挺快调出来了。 主要就是每个数可以有多个,我们可以用一个splay节点存多个数,然后find即可。 注意的是每个操作过后基本都要splay一下保证复杂度
阅读全文
posted @ 2017-07-16 11:12 Galaxies
阅读(258)
评论(0)
推荐(0)
2017年7月15日
poj2096 Collecting Bugs
摘要: 传送门: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
阅读(240)
评论(0)
推荐(0)
bzoj3083 遥远的国度
摘要: 传送门: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
阅读(245)
评论(0)
推荐(0)
bzoj3524/2223 [Poi2014]Couriers
摘要: 传送门: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
阅读(216)
评论(0)
推荐(0)
uoj311 【UNR #2】积劳成疾
摘要: 传送门:http://uoj.ac/problem/311 【题解】 这题的期望dp好神奇啊(可能是我太菜了) 由于每个位置都完全一样,所以我们设$f_{i,j}$表示审了连续$i$个位置,最大值不超过$j$的期望。 那么只要考虑最大值为$j$的期望,其他从$f_{i,j-1}$加进来即可。 枚举最
阅读全文
posted @ 2017-07-15 15:20 Galaxies
阅读(427)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
···
26
下一页
公告