Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Input: "babad" Output: "b ...
分类:
编程语言 时间:
2018-02-18 15:39:23
阅读次数:
197
原题链接在这里:https://leetcode.com/problems/minimize-max-distance-to-gas-station/description/ 题目: On a horizontal number line, we have gas stations at posit ...
分类:
其他好文 时间:
2018-02-18 11:13:54
阅读次数:
215
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: 这也是《算法导论》中的一个练习题 ...
分类:
其他好文 时间:
2018-02-18 10:33:38
阅读次数:
175
【题目描述】 For a Maximum Segment Tree, which each node has an extra value max to store the maximum value in this node's interval. Implement a modify funct ...
分类:
其他好文 时间:
2018-02-17 20:30:00
阅读次数:
179
题意:求a串的子串与b串的子序列有多少个相匹配,mod=1e9+7; 思路:类似于LCS,如果会LCS的话就很容易(但是我没想通LCS的方程是怎么的来的) 代码: ...
分类:
其他好文 时间:
2018-02-17 14:16:26
阅读次数:
165
【题目描述】 For a Maximum Segment Tree, which each node has an extra value max to store the maximum value in this node's interval. Implement a modify funct ...
分类:
其他好文 时间:
2018-02-16 20:25:31
阅读次数:
179
JavaScript中的递归即函数内调用函数自身,但递归是非常耗内存的,每一次调用都会分配一定的栈空间,达到一定的数量(具体看浏览器)便会溢出报错。 对于尾递归来说,由于只存在一个调用帧,所以永远不会发生“栈溢出”错误。 实际上还是报错了:D。 ...
分类:
其他好文 时间:
2018-02-13 18:57:31
阅读次数:
215
No buffer space available 2009-06-15 14:03 java.net.SocketException: No buffer space available (maximum connections reached?): JVM_Bind 2009-04-14 09: ...
分类:
编程语言 时间:
2018-02-13 18:52:03
阅读次数:
175
当你的程序递归的次数超过999次的时候,就会引发RuntimeError: maximum recursion depth exceeded. 解决方法两个: 1、增加系统的递归调用的次数: import sys sys.setrecursionlimit(n) n为你想要的递归上限 2、优化代码, ...
分类:
编程语言 时间:
2018-02-13 13:31:59
阅读次数:
161
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: "babad" Output: "bab... ...
分类:
其他好文 时间:
2018-02-12 23:41:59
阅读次数:
341