1 class Solution { 2 public: 3 string longestPalindrome(string s) { 4 int min_len=0,max_len=1; 5 int i,j,k; 6 if(s.enpty)return ""...
分类:
其他好文 时间:
2015-09-11 10:44:30
阅读次数:
163
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-09-11 10:41:08
阅读次数:
144
用把失配边也加到正常边以后AC自动机,状态是长度递减的DAG,每个选一个不会匹配字符的转移。dp[u][L]表示当前在tire树上u结点长度还剩L时候不匹配的概率,根据全概率公式跑记忆化搜索。#includeusing namespace std;typedef double ld;const in...
分类:
其他好文 时间:
2015-09-10 17:17:26
阅读次数:
190
Write a function to find the longest common prefix string amongst an array of strings. 1 string longestCommonPrefix(vector& strs) { 2 int i=0,...
分类:
其他好文 时间:
2015-09-10 16:04:41
阅读次数:
95
Problem:Given a string, find the length of the longest substring T that contains at most 2 distinct characters.For example, Given s =“eceba”,T is "ece...
分类:
其他好文 时间:
2015-09-10 12:47:29
阅读次数:
210
由于在项目中有需要对字符串进行截取,然后手残使用了IDE自动提示的substr,没想那么多以为substr和substring没多大区别。然而并不是,且听我一一道来。1. substr(index, length)从起始索引号提取字符串中指定数目的字符。 substr方法可以传入两个参数 index...
分类:
编程语言 时间:
2015-09-10 00:12:20
阅读次数:
232
try{ int t = 1; int i = 5 / --t;}catch (Exception ee){ int i = ee.StackTrace.IndexOf("行号"); string s = ee.StackTrace.Substring(i + 3); ...
表Axm xk张三 语文,历史,音乐李四 体育,语文现在想查询得到xm xk张三 语文张三 历史张三 音乐李四 体育李四 语文1 Select2 a.xm,xk=substring(a.xk,b...
分类:
数据库 时间:
2015-09-09 17:29:46
阅读次数:
247
【题目描述】Given a string, find the length of the longest substring without repeating characters.For example, the longest substring without repeating lette...
分类:
其他好文 时间:
2015-09-08 12:20:24
阅读次数:
94