找出单词的最长公共前缀class Solution {public: string longestCommonPrefix(vector &strs) { int len=strs.size(); if(len==0) return ""; ...
分类:
其他好文 时间:
2014-08-05 00:09:58
阅读次数:
192
无标题文档 微博 私信 评论 @我 我在这里不动,但上面会把我遮住希望把某个元素移除你的视线: 1、display:none; 显示为无 2、visibility:hidden; 隐藏 3、wi...
分类:
Web程序 时间:
2014-08-04 17:24:07
阅读次数:
338
LCS是两个序列相似性的一种度量方法;若序列s1:2,5,7,9,3,1,2 s2:3,5,3,2,8则LCS为:5,3,2思路可参考:http://www.csie.ntnu.edu.tw/~u91029/LongestCommonSubsequence.html具体代码实现为: 1 #in...
分类:
其他好文 时间:
2014-08-04 13:47:37
阅读次数:
290
这题关键注意:T可能有重复,所以得统计次数,我之前理解错了,后来参考别人代码才知道的。思路就是双指针+字符hash,具体见注释 1 class Solution { 2 public: 3 string minWindow(string S, string T) { 4 ...
链接根据题意可以设三段路程分别为A,B,C那么总时间t = A/V+B/U+C/W.这样根据时间大小关系可以跟其余n-1个联立形成n-1个方程。化简后为A(1/vj-1/vi)+B(1/uj-1/ui)+C(1/wj-1/wi)>0这样就可以按照顺时针进行半平面交。初始需要加一个大的平面,可以加上4...
分类:
其他好文 时间:
2014-08-04 10:30:37
阅读次数:
301
题目: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 lo....
分类:
编程语言 时间:
2014-08-04 04:10:26
阅读次数:
374
题目:
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3....
分类:
其他好文 时间:
2014-08-03 23:29:46
阅读次数:
283
题目:uva10285 - Longest Run on a Snowboard(记忆化搜索)
题目大意:给出N * N的矩阵,要求找到一条路径,路径上的值是递减的,求这样的路径的最长长度。
解题思路:记忆话搜索。因为要求最长的路径那么就需要将所有的这样的路径找出,但是直接dfs会超时的。对于同一个位置,从这个点出发的最长路径长度是固定的。所以在找的时候就要将这个位置的最长路径...
分类:
其他好文 时间:
2014-08-03 23:29:06
阅读次数:
299
要求:软件上有一张图片,默认是隐藏的。用户在文本框中输入身份证号(131226198105223452),点击按钮,如果年龄大于18岁,则显示图片。知识点:取当前年份,Date Time Now Year所需用到的函数 函数一: string string.Substring(int s...
1、从官网下载源码
2、编辑一个config.h:
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.in by autoheader. */
/* Define if you want to use libfaad together wi...
分类:
移动开发 时间:
2014-08-03 18:09:55
阅读次数:
414