题目大意:
用集合A中的串构造出一个串,使之让更多的setB中的串成为他的子串。
思路分析:
和
Codeforces 86C 差不多。
不过这里是要用A中的构造。
先用A 和 B的串构造一个自动机。然后对于A集合的尾结点给出一个最大后缀匹配,对于B集合的尾结点给一个权值。
dp[i][j][k] 表示已经构造出来了一个长度为i的串,现在走到了自动机的j结点,i长度后面有k...
分类:
其他好文 时间:
2014-10-03 17:13:14
阅读次数:
227
9月27日后缀数组:【wikioi3160】最长公共子串dp:NOIP2001统计单词个数后缀自动机:【spoj1812】Longest Common Substring II【wikioi3160】最长公共子串【spoj7258】Lexicographical Substring Search扫描...
分类:
其他好文 时间:
2014-10-03 15:17:24
阅读次数:
1374
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[
[2],
[3,4],
[...
分类:
其他好文 时间:
2014-10-01 19:09:51
阅读次数:
144
Given numRows, generate the first numRows of Pascal's triangle.
For example, given numRows = 5,
Return
[
[1],
[1,1],
[1,2,1],
[1,3,3,1],
[1,4,6,4,1]
]
class Solution {
public:
...
分类:
其他好文 时间:
2014-10-01 19:09:11
阅读次数:
130
本文内容收集来自网络#triangle-up { width: 0; height: 0; border-left: 50px solid transparent; border-right: 50px solid transparent; border-bottom:...
分类:
Web程序 时间:
2014-09-30 18:51:59
阅读次数:
162
笔者正在学习uCOS-II,移植到ARM时考虑到数据类型的定义,但对于KeilMDK编译器的数据类型定义还是很模糊,主要就是区分不了shortint、int、long和longint占用多少字节。为了得到一个权威的答案,改用编译器自身得出。一、先定义几个变量,用于存放各数据类型的字节数。//#inc...
分类:
其他好文 时间:
2014-09-30 11:38:02
阅读次数:
494
汽车上的OBD-II接口(母):ELM327用到的引脚:2:SAE-J1850PWM和SAE-1850VPW总线(+)4.车身地5.信号地6.CANhigh(ISO15765-4和SAE-J2284)7.ISO9141-2和ISO14230-4总线的K线10.SAE-J1850PWM协议总线(-)(...
分类:
其他好文 时间:
2014-09-30 11:30:52
阅读次数:
871
虽说题目很简单,也没有优化。但是depend on myself & 一遍就AC还是很让人开心的。。之前二维vector不熟,通过这个题熟了很多。时间复杂度O(n^2),空间复杂度O(n^2). 优化之后可以做到空间复杂度O(1), 见代码2. 1 #include 2 #include 3 #.....
分类:
其他好文 时间:
2014-09-30 09:40:32
阅读次数:
200
Populating Next Right Pointers in Each Node II
Total Accepted: 18934 Total
Submissions: 62031My Submissions
Follow up for problem "Populating Next Right Pointers in Each Node".
What if t...
分类:
其他好文 时间:
2014-09-29 23:45:01
阅读次数:
218
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol...
分类:
其他好文 时间:
2014-09-29 22:48:21
阅读次数:
163