"bzoj" "luogu" 题意 求一个串每个前缀中含有多少个不同字串 $n\le100000$,字符集大小$10^9$ sol 后缀自动机的转移开个$map$就好了。 每次插入以后,新增的贡献就是$len[last] len[fa[last]]$。 累加即可。 code cpp include ...
分类:
其他好文 时间:
2018-03-27 22:00:26
阅读次数:
180
"vjudge" 题意 给你一个串,求不同字串个数。 $n\le10^5$ sol 直接建SAM然后输出$\sum_{i=1}^{tot}len[i] len[fa[i]]$ code cpp include include include using namespace std; const in ...
分类:
其他好文 时间:
2018-03-27 21:58:06
阅读次数:
129
这是一个很细节也很实际的问题,到底用哪个版本? 参考: What Ensembl genome version should I use for alignments? (e.g. toplevel.fa vs. primary_assembly.fa) 大部分都推荐使用soft-mask版本的,也 ...
分类:
其他好文 时间:
2018-03-25 20:47:49
阅读次数:
549
```cpp include include define MAX 500005 int d[MAX],fa[MAX],size[MAX],top[MAX],son[MAX]; int N,M,S,tot=0; int head[MAX]; struct edge{ int v,next; }G[M ...
分类:
其他好文 时间:
2018-03-24 20:39:03
阅读次数:
133
"题目链接 BZOJ" "洛谷" 带修改查询树上带权重心。 依旧点分治。我们考虑怎么计算以x为补给站的答案cost[x].直接用cost[]不好维护,考虑它可以怎么得到。 (以下 x下的子树指点分治时以x为重心访问到的所有节点) 用v_son[x]表示以x为补给站 x下的子树的所有点的贡献,v_fa ...
分类:
其他好文 时间:
2018-03-23 16:16:29
阅读次数:
161
"题目链接 洛谷" "SPOJ" 将每次Solve的重心root连起来,会形成一个深度为logn的树,就叫它点分树吧。。 我们对每个root维护两个东西: 它管辖的子树中所有白点到它上一层(点分树中的fa[x])的距离(记为h1),以及它的所有子树中h1的最大值、次大值(这样就有答案了)(记为h2) ...
分类:
其他好文 时间:
2018-03-21 19:55:26
阅读次数:
189
创建公共Utils 类 [java] view plain copy ApplicationContextRegister [java] view plain copy [java] view plain copy [java] view plain copy @Component @Lazy(fa ...
分类:
Web程序 时间:
2018-03-21 15:07:29
阅读次数:
158
return '<a id="" class="ace_button" href="#" onclick="showItems(\''+row.id+'\',\''+row.tag+'\')"><i class="fa-fa-trash-o">查看明细</i></a>' ...
分类:
Web程序 时间:
2018-03-18 23:20:24
阅读次数:
610
One Person Game There is a very simple and interesting one-person game. You have 3 dice, namely Die1, Die2 and Die3. Die1 has K1 faces. Die2 has K2 fa ...
分类:
其他好文 时间:
2018-03-17 12:15:14
阅读次数:
169
传送门:D - Puzzles 题意:在一个图中,从1开始dfs,求每一个点到达的期望; 思路:(下面是队长写的) 首先求的是到每一个点的步数的期望. 记fa( u ) = v, son( v )表示v的儿子的集合, z是son(v)中的点,其中 z != u , sum[z] 为 z 的子树的大小 ...
分类:
其他好文 时间:
2018-03-16 19:38:06
阅读次数:
291