Given a string S, find the longest palindromic substring in S.Note:This is Part II of the article:Longest Palindromic Substring. Here, we describe an ...
分类:
其他好文 时间:
2014-11-12 21:05:22
阅读次数:
345
题意:给一个长度为n的序列,问每个数关于序列的LIS(longest increasing sequence)是什么角色。这里分了三种:
1、此数没有出现在任意一条LIS中
2、此数出现在至少一条但是不是全部的LIS中
3、此数出现在所有的LIS中
解法:nlgn的LIS算法可以求出以每个i位置结束的LIS长度up[i]。出现在L...
分类:
其他好文 时间:
2014-11-12 19:45:28
阅读次数:
214
SP:BEGIN WHILE instr(_checkstr,_str) 0 DO SELECT sortNum INTO @V FROM InApp_job WHERE jobId = substring(_checkstr,1,instr(_checkstr,_str)-1); DELETE F...
分类:
数据库 时间:
2014-11-11 20:53:35
阅读次数:
217
解题报告求最长路。用SPFA求最长路,初始化图为零,dis数组也为零#include #include #include #include #include #define inf 99999999#define N 110using namespace std;int mmap[N][N],dis...
分类:
其他好文 时间:
2014-11-11 12:39:12
阅读次数:
117
对于一个n*n的矩阵,其中只包含有0,1两种元素且,所有的0都在1之前,请找出矩阵中0最多的一行。(Given an N-by-N matrix of 0s and 1s such that in each row no 0 comes before
a 1, find the row with the most 0s in O(N) time.)
初看这题,想到的算法就是每一行都设置一个计...
分类:
其他好文 时间:
2014-11-10 23:30:00
阅读次数:
446
javascript获取当前页面url中的参数可以使用location的search方法,获取到的是url中?后面的部分,例如http:localhost:8080/Manager/index.jsp?id=1
使用location的search方法可以获取到字符串?id=1;想要获取?后面的键值对可以使用substring方法对其进行截取,截取后获得id=1;需要获得id的值,可以使用spli...
分类:
编程语言 时间:
2014-11-10 23:28:22
阅读次数:
478
在使用Eclipse进行开发的时候,出现了如下的问题:
Description Resource Path Location Type
The project was not built due to "A resource exists with a different case: '/SeenTaoImp_zhV2/bin/seentao'.". Fix the problem, th...
分类:
系统相关 时间:
2014-11-10 20:02:08
阅读次数:
448
Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings. 1 public class Solution { 2 public Str...
分类:
其他好文 时间:
2014-11-10 19:53:49
阅读次数:
228
/** * Wifi广播接收 */ private BroadcastReceiver mNetworkStateReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Int...
分类:
其他好文 时间:
2014-11-10 19:26:54
阅读次数:
267
MySQL 字符串截取函数:left(), right(), substring(), substring_index()。还有 mid(), substr()。其中,mid(), substr() 等价于 substring() 函数,substring() 的功能非常强大和灵活。1. 字符串截取...
分类:
数据库 时间:
2014-11-10 13:32:02
阅读次数:
259