字符串处理题
m悟空
这个作者很懒,什么都没留下…
展开
-
Nikita and string (暴力)
One day Nikita found the string containing letters "a" and "b" only.Nikita thinks that string is beautiful if it can be cut into 3 strings (possibly empty) without changing the order of the letters,...原创 2018-08-26 20:56:11 · 417 阅读 · 0 评论 -
Two Strings Swaps (通过交换 把两个字符串变成相等的)
You are given two strings aa and bb consisting of lowercase English letters, both of length n. The characters of both strings have indices from 1 to n, inclusive.You are allowed to do the following ...原创 2018-08-02 18:15:56 · 1369 阅读 · 0 评论 -
Palindrome (再加多少个字符才能成为回文串 dp)
A palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determines the minimal numb...原创 2018-08-02 16:50:15 · 354 阅读 · 0 评论 -
回文字符串(最少添加多少个字符才能构成回文串,最长公共子序列)
回文串是指aba、abba、cccbccc、aaaa这种左右对称的字符串。每个字符串都可以通过向中间添加一些字符,使之变为回文字符串。例如:abbc 添加2个字符可以变为 acbbca,也可以添加3个变为 abbcbba。方案1只需要添加2个字符,是所有方案中添加字符数量最少的。 收起输入输入一个字符串Str,Str的长度 <= 1000。输出输出最少添加多少个字...原创 2019-02-17 02:16:55 · 3906 阅读 · 0 评论 -
表达式计算 (栈处理带括号的表达式)
问题描述 输入一个只包含加减乖除和括号的合法表达式,求表达式的值。其中除表示整除。输入格式 输入一行,包含一个表达式。输出格式 输出这个表达式的值。样例输入1-2+3*(4-5)样例输出-4数据规模和约定 表达式长度不超过100,表达式运算合法且运算过程都在int内进行。代码如下:#include<bits/stdc++.h...原创 2019-03-01 16:14:05 · 1878 阅读 · 0 评论 -
Subsequence (预处理,判断一个串是不是另一个串的不连续字串)
Give a stringSSandNNstringT_iTi, determine whetherT_iTiis a subsequence ofSS.If ti is subsequence ofSS, printYES,else printNO.If there is an array\lbrace K_1, K_2, K_3,\cdots, K_m \...原创 2019-04-21 15:54:23 · 327 阅读 · 0 评论 -
String Problem(最大最小表示法 + KMP求个数)
Give you a string with length N, you can generate N strings by left shifts. For example let consider the string “SKYLONG”, we can generate seven strings:String RankSKYLONG 1KYLONGS 2YLONGSK 3...原创 2019-04-23 12:19:53 · 252 阅读 · 0 评论 -
最长回文(Manacher 马拉车算法模板解析)
给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长回文串的长度.回文就是正反读都是一样的字符串,如aba, abba等Input输入有多组case,不超过120组,每组输入为一行小写英文字符a,b,c...y,z组成的字符串S两组case之间由空行隔开(该空行不用处理)字符串长度len <= 110000Output每一行一个整数x,对应一组...原创 2019-04-23 16:40:18 · 457 阅读 · 0 评论