码迷,mamicode.com
首页 >  
搜索关键字:longest substring wi    ( 8067个结果
hust 1463 - 第二届“华为杯”初赛题目H
题目描述有m个盒子,第i个盒子的长尾hi,宽为wi。如果两个盒子i,j满足hi#include#includeusing namespace std;const int maxn=20001;struct node{ int x,y;}box[maxn];int a[maxn];bool cm...
分类:其他好文   时间:2014-05-20 02:11:24    阅读次数:251
[leetcode]_Longest Common Prefix
问题:寻找最长公共前缀思路:就是逐一检查每个string中的每一位,碰到不相等的时候,结束;每个string中这一位都相等,加入到common prefix中~public String longestCommonPrefix(String[] strs) { int ...
分类:其他好文   时间:2014-05-19 21:12:05    阅读次数:292
[snippet] get parameter
function(name) { var query=location.search.substring(1); var pairs=query.split("&"); for(var i=0;i<pairs.length;i++) ...
分类:其他好文   时间:2014-05-19 10:43:27    阅读次数:266
【leetcode】Longest Palindromic Substring
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:其他好文   时间:2014-05-18 19:39:55    阅读次数:355
NYOJ 914 Yougth的最大化
Yougth的最大化 时间限制:1000 ms  |  内存限制:65535 KB 难度:4 描述 Yougth现在有n个物品的重量和价值分别是Wi和Vi,你能帮他从中选出k个物品使得单位重量的价值最大吗? 输入有多组测试数据 每组测试数据第一行有两个数n和k,接下来一行有n个数Wi和Vi。 (1 输出输出使得单位价值的最大值。(保留两位小数) 样...
分类:其他好文   时间:2014-05-18 14:37:25    阅读次数:229
LeetCode: Substring with Concatenation of All Words [029]
【题目】 You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without any intervening characters. For example, given: S:...
分类:其他好文   时间:2014-05-18 08:31:48    阅读次数:228
【LeetCode】Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ...
分类:其他好文   时间:2014-05-18 01:52:45    阅读次数:317
CareerCup之1.8 字符串移位包含问题
【题目】 原文: 1.8 Assume you have a method isSubstring which checks if one word is a substring of another. Given two strings, s1 and s2, write code to check if s2 is a rotation of s1 using only one...
分类:其他好文   时间:2014-05-16 01:50:08    阅读次数:311
Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:其他好文   时间:2014-05-15 17:50:38    阅读次数:298
Java编程最差代码
字符串连接误用 错误的写法:String s = ""; for (Person p : persons) { s += ", " + p.getName(); } s = s.substring(2); //remove first comma 正确的写法:StringBuilde...
分类:编程语言   时间:2014-05-15 17:38:49    阅读次数:493
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!