
单调栈
Kirito_Acmer
这个作者很懒,什么都没留下…
展开
-
poj2559 Largest Rectangle in a Histogram
DescriptionA histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the figure on原创 2015-07-13 19:35:28 · 697 阅读 · 0 评论 -
Codeforces Round #305 (Div. 1) B. Mike and Feet
Mike is the president of country What-The-Fatherland. There are n bears living in this country besides Mike. All of them are standing in a line and they are numbered from 1 to n from left to right原创 2015-07-13 20:16:32 · 1037 阅读 · 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 评论 -
poj3250 Bad Hair Day
DescriptionSome of Farmer John's N cows (1 ≤ N ≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wants to count the number of other cows that can原创 2015-07-13 13:21:17 · 906 阅读 · 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 评论 -
九度1497:面积最大的全1子矩阵 (单调队列,单调栈)
题目描述:在一个M * N的矩阵中,所有的元素只有0和1,从这个矩阵中找出一个面积最大的全1子矩阵,所谓最大是指元素1的个数最多。输入:输入可能包含多个测试样例。对于每个测试案例,输入的第一行是两个整数m、n(1矩阵共有m行,每行有n个整数,分别是0或1,相邻两数之间严格用一个空格隔开。输出:对应每个测试案例,输出矩阵中面积最原创 2016-03-26 18:42:51 · 837 阅读 · 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 评论 -
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 评论