
栈
coldfresh
那我们开始吧
展开
-
Largest Rectangle in a Histogram (POJ - 2559 )(栈)
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 figure on the left shows t原创 2017-05-02 14:29:19 · 433 阅读 · 0 评论 -
Editor HDU - 4699 (模拟)
Input 8 I 2 I -1 I 1 Q 3 L D R Q 2 Output 2 3思路:就是模拟了,关键是怎么模拟了,这里用两个栈,如果左移就做边出栈,然后压到右边的栈。通过两个栈来模拟光标左右移动,其也就差不多了。 代码:#include<iostream>#include<cstdio>#include<sta...原创 2018-05-03 14:11:38 · 302 阅读 · 0 评论 -
Ascending Rating【2018 Multi-University Training Contest 3 A题】(单调队列)
Problem Description Before the start of contest, there are n ICPC contestants waiting in a long queue. They are labeled by 1 to n from left to right. It can be easily found that the i-th contestant’s...原创 2018-07-30 20:52:45 · 273 阅读 · 0 评论