栈
weixin_44705665
这个作者很懒,什么都没留下…
展开
-
HDU 1237 栈
读入一个只包含 +, -, *, / 的非负整数计算表达式,计算该表达式的值。 Input 测试输入包含若干测试用例,每个测试用例占一行,每行不超过200个字符,整数和运算符之间用一个空格分隔。没有非法表达式。当一行中只有0时输入结束,相应的结果不要输出。 Output 对每个测试用例输出1行,即该表达式的值,精确到小数点后2位。 Sample Input 1 + 2 4 + 2 * 5 - 7 ...原创 2019-08-06 08:51:27 · 47 阅读 · 0 评论 -
HDU 1506 Largest Rectangle in a Histogram(单调栈)
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 ...原创 2019-08-08 11:40:46 · 39 阅读 · 0 评论 -
POJ 1363 栈
训练栈 There is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. Unfortunately, funds were extremely limited that time. It was possible ...原创 2019-08-06 11:11:53 · 202 阅读 · 0 评论 -
HDU 1023 卡特兰数
As we all know the Train Problem I, the boss of the Ignatius Train Station want to know if all the trains come in strict-increasing order, how many orders that all the trains can get out of the railwa...原创 2019-08-06 16:26:39 · 65 阅读 · 0 评论 -
UVA 673 括号余额
给定一串由()和[]组成的字符串。如果我们规定以下的字符串是合法的字符串: (1) 如果是空串,那么合法字符串。 (2) 如果A、B是合法的,那么AB也是合法的字符串。 (3) 如果A是合法的,那么(A)和[A]都是合法的字符串。 换言之,如果字符串中离任一一个右括号(即’)‘或者’]’)的最近的未配对左括号是配对的,且所有左右括号都已配对,那么它就是一个合法的字符串。 Input 输入先是一个正...原创 2019-08-07 19:32:08 · 156 阅读 · 0 评论 -
POJ 3250 单调栈
Some 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 the top of ...原创 2019-08-07 20:42:33 · 81 阅读 · 0 评论