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 see t...
分类:
其他好文 时间:
2015-05-07 22:16:34
阅读次数:
168
Problem Description
A 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 figur...
分类:
其他好文 时间:
2015-05-07 22:16:16
阅读次数:
143
Description
Bill 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 li...
分类:
其他好文 时间:
2015-05-07 22:12:48
阅读次数:
198
Description
Let N be the set of all natural numbers {0 , 1 , 2 , … }, and R be the set of all real numbers. wi, hi for i = 1 … n are some elements in N, and w0 = 0.
Define set B = { | x, y ∈...
分类:
其他好文 时间:
2015-05-07 22:09:58
阅读次数:
139
A:这题利用单调栈,先预处理出每个位置向下的最远位置,那么每一行单独考虑,每行就相当于一些段的子矩阵个数,利用单调栈维护,每次出栈的时候把大于当前要入栈(高度0的不入栈了)的段的部分计算出来,累加一下答案即可
B:这题可以枚举,因为一个10^15开3方之后是10^5枚举起来是没有问题的,然后枚举一个数字i,等于要计算在max(a, i * i * i)到min(i * i * i, b)区间,有...
分类:
其他好文 时间:
2015-05-04 06:28:46
阅读次数:
155
首先把后缀数组和height数组都搞出来。。。然后用两个单调栈维护$[l, r]$表示对于一个点$x$,满足$height[x] \le height[l..x] \ \&\&\ height[x] 11 #include 12 13 using namespace std;14 typedef ....
分类:
其他好文 时间:
2015-05-03 23:27:36
阅读次数:
148
紫书上分析了很多很多,超详细,= ̄ω ̄=每扫描一行可以计算一个height数组,表示从这块空地向上延伸多少块空地,而且这个数组可以逐行递推。首先对于每一行来说维护一个单调栈,栈里放的是矩形的左上角,而且横坐标c和高度h也都是递增的,另外对于扫描到的同一个右下角,矩形面积的大小只与左上角的横坐标c和高...
分类:
其他好文 时间:
2015-04-29 16:27:04
阅读次数:
140
1012: [JSOI2008]最大数maxnumberTime Limit:3 SecMemory Limit:162 MBSubmit:4909Solved:2221[Submit][Status][Discuss]Description现在请求你维护一个数列,要求提供以下两种操作: 1、 查询...
分类:
其他好文 时间:
2015-04-22 20:38:02
阅读次数:
144
单调栈的思想很巧妙,若进入的元素比栈顶小,则栈顶出栈,把相应信息更新一下,直到要进入的元素比栈顶元素大
//注意这道题和Facer’s string这道题的区别
//该题求的是sa[i]-sa[j]的lcp,需要用到的是height[i+1]-height[j]
//而 Facer’s string这道题用到的是height[i]-height[j]的值,涉及到的是sa[i-1]-sa[j]
...
分类:
其他好文 时间:
2015-04-16 19:57:25
阅读次数:
136