先tarjan缩成DAG,然后答案就变成了最长链,dp的同时计数即可 就是题面太唬人了,没反应过来 ...
分类:
编程语言 时间:
2018-07-31 21:37:45
阅读次数:
129
(传送门) 大意:对于给定串的每个前缀i,求最长的,使这个字符串重复两边能覆盖原前缀i的前缀(就是前缀i的一个前缀),求所有的这些“前缀的前缀”的长度和 利用 p 的性质:前缀 i 的长度为 p[i] 的前缀和后缀是相等的 这说明:如果i有一个公共前后缀长度为j,那么这个前缀i就有一个周期为i-j ...
分类:
其他好文 时间:
2018-07-31 19:08:21
阅读次数:
242
可以吃饭啦!!! A:连通块 ZOJ 1709 Oil Deposits(dfs,连通块个数) B:素数变换 打表+bfs POJ 3216 Prime Path(打表+bfs) C:水bfs HDU 2717 Catch That Cow(常规bfs) D:bfs+状态压缩 HDU 1429 胜利 ...
分类:
其他好文 时间:
2018-07-30 20:19:30
阅读次数:
201
The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of ...
分类:
其他好文 时间:
2018-07-30 18:08:12
阅读次数:
160
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4029 Time Limit: 1 Second Memory Limit: 131072 KB AC代码: ...
分类:
其他好文 时间:
2018-07-30 16:34:33
阅读次数:
182
Description 给定n,m,求$\sum_{i=1}^{n}\sum_{j=1}^{m}\varphi(ij)$模10^9+7的值。 Input 仅一行,两个整数n,m。 Output 仅一行答案。 Sample Input 100000 1000000000 Sample Output 8 ...
分类:
其他好文 时间:
2018-07-30 13:24:12
阅读次数:
186
The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could f ...
分类:
其他好文 时间:
2018-07-28 13:49:09
阅读次数:
147
题目链接 找$[1$ ~ $a-1]$和$[1$ ~ $b]$中各数码出现的次数之后相减就是答案 上代码: ...
分类:
其他好文 时间:
2018-07-27 01:15:54
阅读次数:
114
www.cnblogs.com/shaokele/ bzoj2306: [Ctsc2011]幸福路径 Time Limit: 10 Sec Memory Limit: 256 MB Description 有向图 G有n个顶点 1, 2, …, n,点i 的权值为 w(i)。现在有一只蚂蚁,从给定的 ...
分类:
其他好文 时间:
2018-07-26 21:22:15
阅读次数:
176
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3029 先随便写了个dfs,记录“前 i 次、成功 j 次、容量-残片=k”的概率。因为是否可行只和“成功次数”还有“容量-残片个数”有关,和容量、残片具体数量无关。准备记忆化,但发现状态存不下 ...
分类:
其他好文 时间:
2018-07-24 22:21:00
阅读次数:
165