栈
辣是真滴牛啤
这个作者很懒,什么都没留下…
展开
-
HDU - 1022:Train Problem I(栈)
原题链接As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all o...原创 2019-02-12 20:37:29 · 133 阅读 · 0 评论 -
CodeForces - 612C :Replace To Make Regular Bracket Sequence(栈 - 括号配对)
You are given string s consists of opening and closing brackets of four kinds <>, {}, [], (). There are two types of brackets: opening and closing. You can replace any bracket by another of the ...原创 2019-02-12 21:38:28 · 183 阅读 · 0 评论 -
POJ - 3250:Bad Hair Day(单调栈)
原题链接Farmer John的奶牛在风中凌乱了它们的发型……每只奶牛都有一个身高hi(1 ≤ hi ≤ 1,000,000,000),现在在这里有一排全部面向右方的奶牛,一共有N只(1 ≤ N ≤ 80,000)。对于奶牛i来说,如果奶牛i+1,i+2,……,N这些奶牛的身高严格小于奶牛i,则奶牛i可以看到它们凌乱的发型。比如下面这个例子:== == * - * = * 奶牛面向...原创 2019-02-12 22:29:45 · 215 阅读 · 0 评论 -
POJ - 1363:Rails(栈)
原题链接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-02-13 19:49:52 · 112 阅读 · 0 评论 -
POJ - 2559:Largest Rectangle in a Histogram(单调栈)
本题解析上面链接讲的非常清楚,而且还有别的方法自动化学霸宗学长除了写代码之外就是研究单片机小车,他平时最大的爱好就是到某宝上网购各种各样的小车零件,终于有一天,宗学长组装好了N辆小车,宗把他们依次叫做GZ1, GZ2到CZn。为了想他的好朋友们展示他的成果,宗学长把他的N辆小车放在同一起跑线上启动,开始展示它们的性能,然而,N辆小车在前进了若干距离之后纷纷抛锚gg。但是,宗学长非要说他有更大的...原创 2019-02-14 13:58:41 · 213 阅读 · 0 评论