Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The longest uncommon subsequence is defi ...
分类:
其他好文 时间:
2017-10-17 12:18:49
阅读次数:
104
题意:给定一个字符串,问它的集合中有多少个回文串。 析:dp[i][j] 表示区间 i 到 j,有多少个回文串, 如果 s[i] == s[j] dp[i][j] = dp[i+1][j] + dp[i][j-1] + 1。 否则 dp[i][j] = dp[i+1][j] + dp[i][j-1] ...
分类:
其他好文 时间:
2017-10-15 19:41:21
阅读次数:
148
Given an unsorted array of integers, find the length of longest continuous increasing subsequence. Example 1: Example 2: Note: Length of the array wil ...
分类:
其他好文 时间:
2017-10-15 19:36:02
阅读次数:
137
题意:求在一段序列中满足m<=max-min<=k的最大长度。 解题关键:单调队列+dp,维护前缀序列的最大最小值,一旦大于k,则移动左端点,取max即可。 ...
分类:
其他好文 时间:
2017-10-09 09:55:38
阅读次数:
122
Note: 1. Find a increasing digits number. It's kind of longest increasing subsequence but with fixed size. 2. Remember to remove the zeros from beginn ...
分类:
其他好文 时间:
2017-10-08 16:50:40
阅读次数:
168
这题简直了......不论是基础的处理方式还是维护方式都很巧妙。 ...
分类:
其他好文 时间:
2017-10-06 21:22:08
阅读次数:
159
题目链接:http://poj.org/problem?id=2533 Longest Ordered Subsequence Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 55459 Accepted: 24864 Descr ...
分类:
其他好文 时间:
2017-10-03 21:38:06
阅读次数:
180
题目链接:http://poj.org/problem?id=1458 Common Subsequence Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 55099 Accepted: 22973 Description A ...
分类:
其他好文 时间:
2017-10-03 21:35:50
阅读次数:
169
题目描述 给一列数,要求支持操作: 1.修改某个数的值 2.读入l,r,k,询问在[l,r]内选不相交的不超过k个子段,最大的和是多少。 输入 The first line contains integer n (1?≤?n?≤?105), showing how many numbers the ...
分类:
其他好文 时间:
2017-09-29 09:51:51
阅读次数:
140
Given an unsorted array of integers, find the length of longest continuous increasing subsequence. Example 1: Example 2: Note: Length of the array wil ...
分类:
其他好文 时间:
2017-09-29 00:09:34
阅读次数:
144