题目如下: Return the lexicographically smallest subsequence of text that contains all the distinct characters of text exactly once. Example 1: Example 2: ...
分类:
其他好文 时间:
2019-06-15 10:09:22
阅读次数:
108
EE205 Project 2Assign 2019-05-20 Due 2019-06-18 Longest Palindromic Subsequence Given a sequence, find the length of the longest palindromic subsequen ...
分类:
其他好文 时间:
2019-06-12 19:59:18
阅读次数:
357
Common Subsequence Problem Description A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a se ...
分类:
其他好文 时间:
2019-06-10 15:56:04
阅读次数:
124
找到一个跟我的思路比较接近的参考解决方案: 参考:https://leetcode.com/problems/smallest-subsequence-of-distinct-characters/discuss/308222/show-my-thinking-process ...
分类:
其他好文 时间:
2019-06-09 22:25:27
阅读次数:
136
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4632【题目描述】《回文子串数量》给你一个长度为N(N≤1000)的字符串,你输出它所有的回文子串的数量(对10007取模)。只要从字符串 s 中顺序地取出一些字符(不要求连续,可以是 s 本身,不能是空 ...
分类:
其他好文 时间:
2019-06-08 00:51:39
阅读次数:
107
不会。。。 参考: 思路类似于coin那个题,for循环中在满足条件时就及时更新当下位置的信息 ...
分类:
其他好文 时间:
2019-06-05 19:29:31
阅读次数:
85
题目链接:http://codeforces.com/contest/1157/problem/C2 当左右两边数字相同时,需要判断一下取哪边能得到更长的递增序列 #include <iostream> #include <cstring> #include <algorithm> #include ...
分类:
其他好文 时间:
2019-06-01 16:31:45
阅读次数:
94
各种自动机(待补) Give a string SS and NN string T_iTi? , determine whether T_iTi? is a subsequence of SS. If ti is subsequence of SS, print YES,else print NO ...
分类:
其他好文 时间:
2019-05-30 01:47:30
阅读次数:
340
334. Increasing Triplet Subsequence https://www.cnblogs.com/grandyang/p/5194599.html 要求时间复杂度为O(N),空间复杂度为O(1)。 解题思路:用a来记录最小的数,b来记录次小的数。如果当前数比之前的数还小,则需要 ...
分类:
其他好文 时间:
2019-05-29 10:37:03
阅读次数:
118
用dp解 1)up定义为nums[i-1] < nums[i] down nums[i-1] > nums[i] 两个dp数组, up[i],记录包含nums[i]且nums[i-1] < nums[i]的最长子序列长度 down[], 记录包含nums[i]nums[i-1] > nums[i]的 ...
分类:
其他好文 时间:
2019-05-26 16:02:55
阅读次数:
79