RMQ(Range Minimum/Maximum Query),即区间最值查询,是指这样一个问题:对于长度为n的数列a,回答若干询问RMQ(A,i,j)(i, j 7所以没有更新,但这并不影响询问的结果。2.查询假设我们需要查询区间[l, r]中的最小值,令k = log2(r - l + 1);...
分类:
编程语言 时间:
2015-09-04 19:55:14
阅读次数:
218
#include void MaxSubsseqSum1(int A[], int N) { int ThisSum = 0, MaxSum = -1; int start,end; int temp = 0; for (int i = 0; iMaxSum){ ...
分类:
其他好文 时间:
2015-09-04 17:02:30
阅读次数:
418
解决方案1.查看进程数SQL>show parameter proceNAMETYPEVALUE------------------------------------ ----------- --------------aq_tm_processesinteger1db_writer_proces...
分类:
其他好文 时间:
2015-09-02 23:25:50
阅读次数:
463
在解决ORA-00020:maximum number of processes (150) exceeded问题时,不小心将processes值设置太大,就会造成这个问题。但此时DB已经被shutdown了, 直接startup DB无法启动, 如下报错.SYS> startupORA-00838...
分类:
其他好文 时间:
2015-09-02 23:23:21
阅读次数:
478
Description:Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one uniqu...
分类:
其他好文 时间:
2015-09-02 15:57:57
阅读次数:
218
定义:RMQ(Range Minimum/Maximum Query),即区间最值查询,是指这样一个问题: 对于长度为n的数列A,回答若干询问RMQ(A,i,j) (i,jO(nlogn)*/2 void initRMQ(int n)3 {4 for(int i = 1; i (1 R)...
分类:
编程语言 时间:
2015-09-02 01:58:16
阅读次数:
197
题意:走n步,给出每步向左走概率l,向右走概率r,留在原地的概率 1-l-r,求能达到的最远右边距离的期望。分析;开始按期望逆求的方式分析,但让求的就是右边界没法退,懵了一会,既然逆着不能求,就先正着求概率,再根据期望的定义来求,试试行吗,想了想状态,dp[i][j][k],表示走了i步当前位置是j...
分类:
其他好文 时间:
2015-09-02 00:22:48
阅读次数:
177
func cap(v Type) int返回指定类型的容量,根据不同类型,返回意义不同。数组: 元素个数 (和len(v)一样).数组指针: *v的元素个数 (和len(v)一样).Slice: the maximum length the slice can reach when resliced...
分类:
其他好文 时间:
2015-08-30 17:16:43
阅读次数:
130
天,这题我已经没有底气高呼“水”了。。。题目的地址:https://leetcode.com/problems/sliding-window-maximum/题目内容:Given an arraynums, there is a sliding window of sizekwhich is mov...
Longest Palindromic SubstringGiven a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there...
分类:
编程语言 时间:
2015-08-29 22:58:51
阅读次数:
160