http://poj.org/problem?id=3693 整体思路就是枚举长度L,看长度为L的字符串在s中连续出现了几次。 既然长度为L的串是重复出现的,那么s[0]…s[L]…s[2*L]…中相邻的两个一定出现在重复的L串中。(并不一定在首尾位置,也可能出现在中间)。 那么我们求i*L和(i+ ...
分类:
编程语言 时间:
2017-08-11 19:31:49
阅读次数:
236
下面一个Java类是已经写好的根据配置文件动态创建多dataSource的代码,其原理也很简单,就是读取配置文件,根据配置文件中配置的数据源数量,动态创建dataSource并注册到Spring中。 代码如下: 将该Java文件直接添加到项目中便可,无其他任何代码耦合,就是单纯一个类。 再来看一下在 ...
分类:
编程语言 时间:
2017-08-11 16:03:33
阅读次数:
307
Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Example 2: Note: 思路:给出一个数组找出里面三个元素乘积的最大 ...
分类:
其他好文 时间:
2017-08-11 15:56:40
阅读次数:
143
http://blog.sina.com.cn/s/blog_71f8aa010100vusp.html MySQL多Text字段报8126错误(解决过程) Row size too large. The maximum row size for the used table type, not c ...
分类:
数据库 时间:
2017-08-11 10:49:23
阅读次数:
396
Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: Construct the maximum tree by the given array a ...
分类:
其他好文 时间:
2017-08-10 13:40:47
阅读次数:
110
53. Maximum Subarray【leetcode】 Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, g ...
分类:
其他好文 时间:
2017-08-10 11:42:48
阅读次数:
152
以下仅为个人理解: 前言 不管是新手还是老手,在做移动端布局时页面头部都会引入这句话<mate name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, ...
分类:
其他好文 时间:
2017-08-10 10:16:51
阅读次数:
185
Stockbroker Grapevine Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 37069 Accepted: 20612 Description Stockbrokers are known to overreact ...
分类:
其他好文 时间:
2017-08-09 19:14:46
阅读次数:
148
A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = <x1, x2, ..., xm> another se ...
分类:
其他好文 时间:
2017-08-09 12:46:36
阅读次数:
134
The best strategy to play the game is to minimize the maximum loss you could possibly face. Definition of dp[i][j]: minimum number of money to guarant ...
分类:
其他好文 时间:
2017-08-08 21:52:11
阅读次数:
116