码迷,mamicode.com
首页 >  
搜索关键字:sliding    ( 270个结果
POJ2823 Sliding Window(单调队列)
单调队列,我用deque维护。这道题不难写,我第二次写单调队列,1次AC。-----------------------------------------------------------------------------------#include#include#include#defin...
分类:Windows程序   时间:2015-03-20 23:37:25    阅读次数:253
POJ 2823 Sliding Window(单调队列)
题意:给定一个长度为n的序列,依次求出(i,i+k-1) (i∈(0,n-1),i 本题有多种解法。首先,暴力的时间复杂度是O((n-k)*klogk),所以pass。 解法1:维护一个单调递增的队列(手写),队头即为最小值。同理求出最大值。 解法2:维护一个优先队列(priority_queue即可) 解法3:线段树 这里给出单调队列解法: #include #inc...
分类:Windows程序   时间:2015-03-02 19:09:42    阅读次数:200
【单调队列】poj2823 Sliding Window
#includeusing namespace std;#define N 1000001int n,K,a[N],head=1,tail=1,q[N],ans[N];int main(){ scanf("%d%d",&n,&K); for(int i=1;i=head) --tail; q[...
分类:Windows程序   时间:2015-02-28 18:03:09    阅读次数:223
hdu 1034 Eight 传说中的八数码问题。真是一道神题,A*算法+康托展开
Problem Description The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all packed into a 4 by 4 frame with one tile m...
分类:编程语言   时间:2015-02-15 09:29:04    阅读次数:1023
POJ 2823 Sliding Window (滑动窗口的最值问题 )
Sliding WindowTime Limit: 12000MSMemory Limit: 65536KTotal Submissions: 41264Accepted: 12229Case Time Limit: 5000MSDescriptionAn array of size n ≤ 106...
分类:Windows程序   时间:2015-01-29 17:28:57    阅读次数:197
POJ 2823 Sliding Window
题意很简单,给出n,m。查询连续m个数的最大值和最小值。 我用线段树 裸的。有人用的单调队列。 不过很忧伤的是G++ TLE,但是C++ AC了。 #include #include #include #include #include #include #include #include #include #include #include #include #includ...
分类:Windows程序   时间:2015-01-27 16:28:58    阅读次数:232
左右侧滑菜单的使用
转载请注明出处:  我们平时看到的菜单,都有侧滑菜单,有的只有右侧侧滑菜单,有的只有右侧侧滑菜单,有的左侧和右侧都有侧滑菜单。 下面介绍一个有三种模式的侧滑菜单,只有左侧,只有右侧,左侧和右侧都有。 首先要导入一个包,源码Demo中可以下载,然后引入项目中。 baseMenu = new SlidingMenu(this); baseMenu.setTouchModeAbove(Sli...
分类:其他好文   时间:2015-01-22 18:14:15    阅读次数:158
[LeetCode] Sliding Window Maximum
Question:AlongarrayA[]isgiventoyou.Thereisaslidingwindowofsizewwhichismovingfromtheveryleftofthearraytotheveryright.Youcanonlyseethewnumbersinthewindow.Eachtimetheslidingwindowmovesrightwardsbyoneposition.Followingisanexample:Thearrayis[13-1-35367],andwis3...
分类:Windows程序   时间:2015-01-19 11:08:04    阅读次数:305
Sliding Window Maximum
A long array A[] is given to you. There is a sliding window of size w which is moving from the very left of the array to the very right. You can only ...
分类:Windows程序   时间:2015-01-12 19:05:36    阅读次数:234
sliding menu
http://www.androiduipatterns.com/2012/06/emerging-ui-pattern-side-navigation.htmlhttps://github.com/mattlogan/CircleMenu/tree/master/samplehttps://git...
分类:其他好文   时间:2015-01-10 23:40:58    阅读次数:225
270条   上一页 1 ... 21 22 23 24 25 ... 27 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!