码迷,mamicode.com
首页 >  
搜索关键字:longest ordered subs    ( 3212个结果
LeetCode 687. Longest Univalue Path 最长同值路径 (C++/Java)
题目: Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the ...
分类:编程语言   时间:2020-02-23 19:56:52    阅读次数:92
无重复字符的最长子串
无重复字符的最长子串 题目链接:https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/ 给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 输入: "abcabcbb" ...
分类:其他好文   时间:2020-02-23 09:52:15    阅读次数:59
[Algo] 253. Longest Substring Without Repeating Characters
Given a string, find the longest substring without any repeating characters and return the length of it. The input string is guaranteed to be not null ...
分类:其他好文   时间:2020-02-20 22:14:59    阅读次数:62
leetcode3 Longest Substring Without Repeating Characters
1 """ 2 Given a string, find the length of the longest substring without repeating characters. 3 Example 1: 4 Input: "abcabcbb" 5 Output: 3 6 Explanat ...
分类:其他好文   时间:2020-02-19 21:02:41    阅读次数:53
leetcode 14. Longest Common Prefix
题目内容 Example: 分析过程 题目归类: 垂直比较 题目分析: 最简单的思路就是从头开始,第一轮比较第一个字符,第二轮比较第二个字符·····这样的效率比较低。 新的方法是,(接下来的数组代表字符串,0代表strs[0])0和1比较后存到0,然后0和2比较后保存到0····· 利用Strin ...
分类:其他好文   时间:2020-02-17 16:13:55    阅读次数:51
[CF1304D] Shortest and Longest LIS - 贪心
看样例, 的堪称一段,比如样例就是 每段内必须下降,考虑让它连续,然后让段膜取当前没去过的最小值即可 ...
分类:其他好文   时间:2020-02-17 16:04:58    阅读次数:64
[CF1034B] Longest Palindrome - 贪心
如果自己是回文串可以做中心 如果一个串和另一个串的转置相等则可以凑一对 优先配对 ...
分类:其他好文   时间:2020-02-17 15:56:55    阅读次数:105
Codeforces 1304D. Shortest and Longest LIS
根据题目,我们可以找最短的LIS和最长的LIS,找最短LIS时,可以将每一个increase序列分成一组,从左到右将最大的还未选择的数字填写进去,不同组之间一定不会存在s[i]<s[j]的情况,保证满足题意,找最长LIS,可以找补集,将每个decrease序列分成一组,找到后取反即可 #includ ...
分类:其他好文   时间:2020-02-16 15:04:07    阅读次数:71
Codeforces 1304B. Longest Palindrome
根据数据范围,暴力可以解决,对每一个串,找与其互为回文的串,或者判断自身是否为回文串,然后两两将互为回文的串排列在头尾,中间放且只能最多放一个自身为回文串的串,因为题目说每个串都是不同的 #include<bits/stdc++.h> using namespace std; #define low ...
分类:其他好文   时间:2020-02-16 14:54:52    阅读次数:85
CF1304D Shortest and Longest LIS
"Problem Link" 一种很巧妙的做法 我们从第二个样例开始讲 想要 LIS 最小,我们就先这样放置 然后如果碰到一连串的 小于 号,那就把那一段小于号所在的数字段 整段翻转 也就是说 ...
分类:其他好文   时间:2020-02-16 13:23:52    阅读次数:70
3212条   上一页 1 ... 15 16 17 18 19 ... 322 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!