• 【Leetcode】Longest Palindromic Substring

    时间:2023-02-21 13:42:16

    问题:https://leetcode.com/problems/longest-palindromic-substring/给定一个字符串 S,求出 S 的最长回文子串思路:1. 回文:一个字符串从前和从后读一致。S = "ABBA"  从前读:ABBA,从后读:ABBA2. 最简单的做法:列出所...

  • 2017 四川省赛 E.Longest Increasing Subsequence【思维+贪心】

    时间:2023-02-02 20:31:26

    题面下载:https://icpc-camp-cdn.b0.upaiyun.com/permanent/problems/sichuan-2017.pdf 题目大意: 给你N个数组成的序列,现在规定F【i】表示的是以a【i】结尾的最长上升子序列长度。 LIS(1)表示的是删除第一个数之后,F...

  • 1040 Longest Symmetric String (25分)(dp)

    时间:2023-01-31 04:08:34

    Given a string, you are supposed to output the length of the longest symmetric sub-string. For example, given Is PAT&TAP symmetric?, the longest s...

  • PAT 甲级 1040 Longest Symmetric String

    时间:2023-01-31 04:08:28

    https://pintia.cn/problem-sets/994805342720868352/problems/994805446102073344Given a string, you are supposed to output the length of the longest symm...

  • 【PAT甲级】1040 Longest Symmetric String (25 分)(cin.getline(s,1007))

    时间:2023-01-31 04:08:16

    题意:输入一个包含空格的字符串,输出它的最长回文子串的长度。AAAAAccepted code: #define HAVE_STRUCT_TIMESPEC #include<bits/stdc++.h> using namespace std; char s[]; int main(){...

  • 1040. Longest Symmetric String (25)

    时间:2023-01-31 04:08:10

    题目链接:http://www.patest.cn/contests/pat-a-practise/1040题目:1040. Longest Symmetric String (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, Yue...

  • PAT甲题题解-1040. Longest Symmetric String (25)-求最长回文子串

    时间:2023-01-31 04:08:04

    博主欢迎转载,但请给出本文链接,我尊重你,你尊重我,谢谢~http://www.cnblogs.com/chenxiwenruo/p/6789177.html特别不喜欢那些随便转载别人的原创文章又不给出链接的所以不准偷偷复制博主的博客噢~~给出一个字符串,让你找出其中最长的回文子串的长度因为长度最多...

  • leetcode-algorithms-3 Longest Substring Without Repeating Characters

    时间:2023-01-27 20:24:20

    leetcode-algorithms-3 Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating charact...

  • LintCode 78:Longest Common Prefix

    时间:2023-01-18 23:59:00

     public class Solution { /** * @param strs: A list of strings * @return: The longest common prefix */ public String longestCommonPre...

  • SPOJ 1811 LCS - Longest Common Substring

    时间:2023-01-14 17:29:26

    思路和SPOJ 1812 LCS2 - Longest Common Substring II一个思路,改成两个串就有双倍经验了代码#include <cstdio>#include <algorithm>#include <cstring>using names...

  • 【leedcode】longest-substring-without-repeating-characters

    时间:2023-01-12 18:31:34

    Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length...

  • [POJ 3764] The xor-longest Path

    时间:2023-01-12 00:11:28

    Description多组数据给你一颗树,然后求一条最长异或路径,异或路径长度定义为两点间简单路径上所有边权的异或和。Solution首先 dfs 一遍,求出所有的点到根节点(随便选一个)的边权的异或和,用 D 数组来存下。不难发现,树上 x 到 y 的路径上所有边权的 xor 结果就等于 D[x]...

  • 68. Longest Common Prefix

    时间:2023-01-05 09:19:24

    Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings.思路:两两字符串挨着找。水题。string commonPrefix(string s...

  • 2019 Multi-University Training Contest 2 - Longest Subarray

    时间:2023-01-03 15:28:44

    线段树 每次枚举右端点,用线段树的区间加来表示合法区间的覆盖,最后找到最大值为c的最小位置就是左端点 这里为了方便,把每个数第一次出现的位置都当成0,最后一次当成n+1。 一开始需要把0~第一次出现的位置-1的区间覆盖掉,当我们枚举到i的时候,由于i这个位置的数必须选,所以他出现的次数只能是大于等于...

  • 蜗牛慢慢爬 LeetCode 5.Longest Palindromic Substring [Difficulty: Medium]

    时间:2022-12-29 14:15:54

    题目 Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Input: "babad"Output: ...

  • Longest Common Subsequence (LCS)

    时间:2022-12-28 15:18:54

    最长公共子序列(LCS)是经典的DP问题,求序列a[1...n], b[1..m]的LCS。状态是DP[i][j],表示a[1..i],b[1..j]的LCS。DP转移方程是DP[i][j]=DP[i-1][j-1]+1,a[i] == b[j]max{ DP[i][j-1], DP[i-1][j]...

  • LeetCode : Given a string, find the length of the longest serial substring without repeating characters.

    时间:2022-12-23 22:18:34

    Given a string, find the length of the longest serial substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which t...

  • leetcode-【中等题】5. Longest Palindromic Substring

    时间:2022-12-22 18:57:14

    题目Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique long...

  • Leetcode Longest Palindromic Substring

    时间:2022-12-19 22:10:54

    Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes...

  • 【POJ3764】The xor-longest Path Trie树+异或性质

    时间:2022-12-17 09:22:34

    #include <stdio.h>int main(){puts("转载请注明出处[vmurder]谢谢");puts("网址:blog.csdn.net/vmurder/article/details/43486733");} 题意: 多组数据、 给你一颗树, 然后求一条最长异或...