
单调队列
Kirito_Acmer
这个作者很懒,什么都没留下…
展开
-
FZU1894 志愿者选拔
Problem Description世博会马上就要开幕了,福州大学组织了一次志愿者选拔活动。参加志愿者选拔的同学们排队接受面试官们的面试。参加面试的同学们按照先来先面试并且先结束的原则接受面试官们的考查。面试中每个人的人品是主要考查对象之一。(提高人品的方法有扶老奶奶过街,不闯红灯等)作为主面试官的John想知道当前正在接受面试的同学队伍中人品值最高的是多少。于是他请你帮原创 2015-05-15 16:39:10 · 844 阅读 · 0 评论 -
poj3415 Common Substrings (后缀数组+单调队列)
Time Limit: 5000MS Memory Limit: 65536KTotal Submissions: 9414 Accepted: 3123DescriptionA substring of a string T is defined as:T(i, k)=TiTi+1...Ti+k-1, 1≤i≤i+k-1≤|T|.原创 2016-04-30 17:02:37 · 648 阅读 · 0 评论 -
hdu5662 YJQQQAQ and the function (单调栈)
Problem DescriptionYJQQQAQ has an array A of length n. He defines a function fl,r,k where l,r,k are positive integers that satisfies l≤r and r×k≤n, and the value of the function equals to原创 2016-04-13 11:20:50 · 854 阅读 · 0 评论 -
九度1497:面积最大的全1子矩阵 (单调队列,单调栈)
题目描述:在一个M * N的矩阵中,所有的元素只有0和1,从这个矩阵中找出一个面积最大的全1子矩阵,所谓最大是指元素1的个数最多。输入:输入可能包含多个测试样例。对于每个测试案例,输入的第一行是两个整数m、n(1矩阵共有m行,每行有n个整数,分别是0或1,相邻两数之间严格用一个空格隔开。输出:对应每个测试案例,输出矩阵中面积最原创 2016-03-26 18:42:51 · 837 阅读 · 0 评论 -
zjnu1735BOB (单调队列,单调栈)
DescriptionLittle Bob is a famous builder. He bought land and wants to build a house. Unfortunately, the problem is theland’s terrain, it has a variable elevation.The land is shaped like a rec原创 2016-03-24 13:38:01 · 666 阅读 · 0 评论 -
1006 How many?
Time Limit: 3000MS Memory Limit: 65536KTotal Submissions: 36 Accepted: 2Description有一天,小Q给了小J一些数字,让小J帮忙找到其中最大的数,由于小J是一个程序猿,当然写了一个代码很快的解决了这个问题。这时,邪恶的小Y又出现了,他问小J,假如我只需要知道这些数字原创 2015-12-07 20:15:54 · 585 阅读 · 0 评论 -
poj2796 Feel Good
DescriptionBill is developing a new mathematical theory for human emotions. His recent investigations are dedicated to studying how good or bad days influent people's memories about some period of原创 2015-07-13 18:50:55 · 970 阅读 · 0 评论 -
hdu5289 Assignment
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2555 Accepted Submission(s): 1200Problem DescriptionTom owns a company and he i原创 2015-08-17 11:45:01 · 785 阅读 · 0 评论 -
hdu3415 Max Sum of Max-K-sub-sequence
Problem DescriptionGiven 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 calcula原创 2015-05-18 20:33:55 · 576 阅读 · 0 评论 -
hdu3706 Second My Problem First
Problem DescriptionGive you three integers n, A and B. Then we define Si = Ai mod B and Ti = Min{ Sk | i-A = 1}Your task is to calculate the product of Ti (1 InputEach line will原创 2015-05-18 13:45:45 · 1225 阅读 · 0 评论 -
poj2823 Sliding Window
DescriptionAn array of size n ≤ 106 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the wi原创 2015-05-15 12:42:13 · 882 阅读 · 0 评论 -
hdu3530 Subsequence
Problem DescriptionThere is a sequence of integers. Your task is to find the longest subsequence that satisfies the following condition: the difference between the maximum element and the minimum原创 2015-05-16 11:08:40 · 1163 阅读 · 2 评论