码迷,mamicode.com
首页 >  
搜索关键字:单调队列    ( 1102个结果
POJ 2823 Sliding Window (单调队列)
Sliding Window Time Limit: 12000MS   Memory Limit: 65536K Total Submissions: 42278   Accepted: 12479 Case Time Limit: 5000MS Description An array of size n ≤ 106 i...
分类:Windows程序   时间:2015-04-14 19:51:26    阅读次数:172
HDU 3415 Max Sum of Max-K-sub-sequence(单调队列)
Problem Description Given a circle sequence A[1],A[2],A[3]......A[n]. Circle sequence means the left neighbour of A[1] is A[n] , and the right neighbour of A[n] is A[1]. Now your job is to calculate...
分类:其他好文   时间:2015-04-14 19:49:36    阅读次数:133
HDU Non-negative Partial Sums (单调队列)
Problem Description You are given a sequence of n numbers a0,..., an-1. A cyclic shift by k positions (0k ak+1,..., an-1, a0, a1,..., ak-1. How many of the n cyclic shifts satisfy the condition tha...
分类:其他好文   时间:2015-04-14 18:03:29    阅读次数:149
单调队列优化DP
Max Sum of Max-K-sub-sequenceTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6277Accepted Submissi...
分类:其他好文   时间:2015-04-12 11:58:11    阅读次数:150
[hdu5033]单调队列
题意:x轴上有n棵树,询问你站在某个点的视角。从左至右,单调队列(类似凸包)维护下。我强迫症地写了个模板QAQ 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 ...
分类:其他好文   时间:2015-04-12 06:46:39    阅读次数:161
[hdu4123]dfs区间化+RMQ
题意:给一个树编号0~n-1,一个数组a[i]为节点i在树上走的最大距离(不重复点),然后求最大的区间,使得区间最大差异小于某个值。dfs求出每个数组,同时区间化。枚举区间左边界,右边界同样递增,类似单调队列,区间最值用RMQ查询(常数小)。 1 #pragma comment(linker, "....
分类:其他好文   时间:2015-04-12 06:46:21    阅读次数:188
[hdu1506]单调队列(栈)
题意:http://acm.hdu.edu.cn/showproblem.php?pid=1506看图一目了然。两个方向单调队列维护下。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #includ...
分类:其他好文   时间:2015-04-12 06:45:52    阅读次数:210
[hdu3530]单调队列
题意:求满足最大元素与最小元素之差在一定范围的连续区间的最大长度。单调队列经典应用。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include ...
分类:其他好文   时间:2015-04-12 06:44:51    阅读次数:140
hdu 2430 Beans 单调队列
#include #include #include #include #include #include #include #include using namespace std; //题意:从num[1]~num[n]中取一段连续的序列,使得(num[i]+...+num[j])%p<=k且该序列的和最大化 //令ma=a%mod,mb=b%mod,如果ma<mb,那么(a-b)%mod的值...
分类:其他好文   时间:2015-04-02 09:09:16    阅读次数:174
【BZOJ 1345】 [Baltic2007]序列问题Sequence
单调队列~...
分类:其他好文   时间:2015-04-01 15:25:20    阅读次数:142
1102条   上一页 1 ... 92 93 94 95 96 ... 111 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!