https://leetcode.com/problems/longest-uncommon-subsequence-i/ Given a group of two strings, you need to find the longest uncommon subsequence of this  ...
                            
                            
                                分类:
其他好文   时间:
2019-02-09 19:22:08   
                                阅读次数:
174
                             
                    
                        
                            
                            
                                    LCS是Longest Common Subsequence的缩写,即最长公共子序列。一个序列,如果是两个或多个已知序列的子序列,且是所有子序列中最长的,则为最长公共子序列。(摘自百度百科) 一.DP通法 给定串1和串2,求其LCS 譬如给定2个序列: 求其最长的公共子序列。 显然长度是3,包含3  ...
                            
                            
                                分类:
其他好文   时间:
2019-02-09 01:00:28   
                                阅读次数:
183
                             
                    
                        
                            
                            
                                Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such that i < j < k and ai < ak < aj. Design an algorithm th ...
                            
                            
                                分类:
其他好文   时间:
2019-02-08 10:34:26   
                                阅读次数:
202
                             
                    
                        
                            
                            
                                    1 #define _for(i,a,b) for(int i = (a);i & nums) 6 { 7 int sz = nums.size(); 8 vector> dp (sz,{1,1});//LISlen times 9 10 int LISlen = 1; 1... ...
                            
                            
                                分类:
其他好文   时间:
2019-02-07 09:23:37   
                                阅读次数:
199
                             
                    
                        
                            
                            
                                A numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequence of the given numeric sequence ( a1, a2, ..., aN) be any sequence ( ai1, ...
                            
                            
                                分类:
其他好文   时间:
2019-02-03 18:04:16   
                                阅读次数:
192
                             
                    
                        
                            
                            
                                    题目描述 给一个 N×N 的矩阵 M,可以取连续的一段数(必须是横着或者竖着或者斜着,这个矩阵是循环的,具体如下)。要求找到一个子序列,使得这个序列的和最大。对于 N=8 的矩阵,如下序列都是合法的: M2,1,M2,2,M2,3,M2,4,M2,5,M2,6,M2,7,M2,8. M2,2,M2, ...
                            
                            
                                分类:
其他好文   时间:
2019-01-30 20:54:34   
                                阅读次数:
137
                             
                    
                        
                            
                            
                                    Given a sequence of K integers { N?1??, N?2??, ..., N?K?? }. A continuous subsequence is defined to be { N?i??, N?i+1??, ..., N?j?? } where 1. The Max ...
                            
                            
                                分类:
其他好文   时间:
2019-01-23 00:19:14   
                                阅读次数:
136
                             
                    
                        
                            
                            
                                    DP式很容易得到,发现是线性递推形式,于是可以矩阵加速。又由于是区间形式,所以用线段树维护。 https://www.cnblogs.com/Miracevin/p/9124511.html 关键在于证明区间操作中,可以直接在打标记的位置翻转矩阵两行两列。 上面网址用代数形式证了一遍,这里考虑从矩阵 ...
                            
                            
                                分类:
其他好文   时间:
2019-01-19 20:08:54   
                                阅读次数:
266
                             
                    
                        
                            
                            
                                    问题描述 对于一串数A={a1a2a3…an},它的子序列为S={s1s2s3…sn},满足{s1<s2<s3<…<sm}。求A的最长子序列的长度。 动态规划法 算法描述: 设数串的长度为n,L[i]为以第i个数为末尾的最长上升子序列的长度,a[i]为数串的第i个数。 L[i]的计算方法为:从前i- ...
                            
                            
                                分类:
其他好文   时间:
2019-01-16 22:43:42   
                                阅读次数:
259
                             
                    
                        
                            
                            
                                public class Solution { / @param nums: An integer array @return: The length of LIS (longest increasing subsequence) / public int longestIncreasingSubs ...
                            
                            
                                分类:
其他好文   时间:
2019-01-16 13:18:18   
                                阅读次数:
185