栈
RookieZQF
尽自己最大努力才能不后悔
展开
-
Word Reversal
DescriptionFor each list of words, output a line with each word reversed without changing the order of the words.This problem contains multiple test cases!The first line of a multiple input翻译 2015-11-03 16:06:21 · 1163 阅读 · 0 评论 -
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 th翻译 2015-11-09 19:18:39 · 194 阅读 · 0 评论 -
NYOJ 35 表达式求值 or 267 郁闷的C小加(二)
描述 聪明的你帮助C小加解决了中缀表达式到后缀表达式的转换(详情请参考“郁闷的C小加(一)”),C小加很高兴。但C小加是个爱思考的人,他又想通过这种方法计算一个表达式的值。即先把表达式转换为后缀表达式,再求值。这时又要考虑操作数是小数和多位数的情况。输入第一行输入一个整数T,共有T组测试数据(T每组测试数据只有一行,是一个长度不超过1000的字符串,表示这个运算式,每个运算式都是以“=翻译 2016-01-23 18:26:54 · 413 阅读 · 0 评论 -
玉蟾宫
题目描述 Description 有一天,小猫rainbow和freda来到了湘西张家界的天门山玉蟾宫,玉蟾宫宫主蓝兔盛情地款待了它们,并赐予它们一片土地。 这片土地被分成N*M个格子,每个格子里写着'R'或者'F',R代表这块土地被赐予了rainbow,F代表这块土地被赐予了freda。 现在freda要在这里卖萌。。。它要找一块矩形土地,要求这片土地都标着'F'并且翻译 2015-11-29 16:20:46 · 1152 阅读 · 0 评论 -
Rails
DescriptionThere 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 wa翻译 2015-11-03 17:22:27 · 265 阅读 · 0 评论 -
Flipping Burned Pancakes
DescriptionThe cook at the Frobbozz Magic Pancake House sometimes falls asleep on the job while cooking pancakes. As a result, one side of a stack of pancakes is often burned. Clearly, it is bad b翻译 2015-11-12 08:36:34 · 509 阅读 · 0 评论 -
Hanoi Tower
DescriptionYou all must know the puzzle named "The Towers of Hanoi". The puzzle has three pegs (peg 1, peg 2 and peg 3) and N disks of different radii. Initially all disks are located on the first翻译 2015-11-11 20:06:03 · 323 阅读 · 0 评论 -
Loongint 的花篮
DescriptionLoongint 要和 MM 结婚了。在两人的走进礼堂的红地毯两侧,需要摆一些装饰用的花篮,有一些不同高度的花篮,现在这些花篮被 Loongint 依照自己的美学观念编号为S1, S2, S3 … Sn(两侧的花篮高度一样)。可 Loongint的 MM 对这些花篮的摆放方式有不同的看法,她觉得满足以下条件的花篮摆放才是最好的。如果对于区间[Si, Sj](1 ≤i<j翻译 2015-11-11 12:58:28 · 701 阅读 · 0 评论 -
诺诺的队列
题目描述诺诺表现、成绩双优,于是校长给她一笔money,让她去外地玩玩。由于本地没有飞机场,所以诺诺只能坐火车去咯。所以诺诺今天去火车站买票,却看到了N多人在火车站里啊,诺诺一阵头晕。机灵的她突然发现,有N个人在队伍里(和上文的N毫无关系- -||),人们等得很无聊,于是他们开始转来转去,想在队伍里寻找自己的熟人。队列中任意两个人A和B,如果他们是相邻或他们之间没有人比A或B高,那么他们是可以翻译 2015-11-10 17:55:21 · 425 阅读 · 0 评论 -
皇后问题
常见的八皇后问题采用非递归实现代码。其实加个栈保存能放在的是哪一列就行了。#include const int maxn = 35;int ans, n, stack[maxn];int is_ok ( int k ){ for ( int i = 1; i < k; i ++ ) //判断是否和前面的行列重复 if ( k-stack[k] == i翻译 2015-11-08 15:12:30 · 222 阅读 · 0 评论 -
Mapping the Route
DescriptionFinding a path through a maze is a popular problem for computers. In this problem, a maze will consist of a rectangular array of square cells, each of which may have walls on the north, s翻译 2015-11-06 09:43:33 · 408 阅读 · 0 评论 -
Train Problem I
DescriptionAs 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 fas翻译 2015-11-04 22:07:21 · 128 阅读 · 0 评论 -
简单计算器
Description读入一个只包含 +, -, *, / 的非负整数计算表达式,计算该表达式的值。 Input测试输入包含若干测试用例,每个测试用例占一行,每行不超过200个字符,整数和运算符之间用一个空格分隔。没有非法表达式。当一行中只有0时输入结束,相应的结果不要输出。 Output对每个测试用例输出1行,即该翻译 2015-11-04 21:19:48 · 447 阅读 · 0 评论 -
ACboy needs your help again!
DescriptionACboy was kidnapped!! he miss his mother very much and is very scare now.You can't image how dark the room he was put into is, so poor :(.As a smart ACMer, you want to get ACboy o翻译 2015-11-05 09:19:47 · 632 阅读 · 0 评论 -
Flipper
DescriptionLittle Bobby Roberts (son of Big Bob, of Problem G) plays this solitaire memory game called Flipper. He starts withn cards, numbered 1 through n, and lays them out in a row with the c翻译 2015-11-05 16:07:45 · 313 阅读 · 0 评论 -
(Your)((Term)((Project)))
DescriptionYou have typed the report of your term project in your personal computer. There are several one line arithmetic expressions in your report. There is no redundant parentheses in the expr翻译 2015-11-04 19:23:34 · 541 阅读 · 0 评论 -
愚人节的礼物
Description四月一日快到了,Vayko想了个愚人的好办法――送礼物。嘿嘿,不要想的太好,这礼物可没那么简单,Vayko为了愚人,准备了一堆盒子,其中有一个盒子里面装了礼物。盒子里面可以再放零个或者多个盒子。假设放礼物的盒子里不再放其他盒子。用()表示一个盒子,B表示礼物,Vayko想让你帮她算出愚人指数,即最少需要拆多少个盒子才能拿到礼物。翻译 2015-11-04 21:34:02 · 296 阅读 · 0 评论 -
Web Navigation
DescriptionStandard web browsers contain features to move backward and forward among the pages recently visited. One way to implement these features is to use two stacks to keep track of the pages t翻译 2015-11-03 15:44:52 · 1078 阅读 · 0 评论 -
NOIP 2005 等价表达式(hash算法)
题目描述 Description明明进了中学之后,学到了代数表达式。有一天,他碰到一个很麻烦的选择题。这个题目的题干中首先给出了一个代数表达式,然后列出了若干选项,每个选项也是一个代数表达式,题目的要求是判断选项中哪些代数表达式是和题干中的表达式等价的。这个题目手算很麻烦,因为明明对计算机编程很感兴趣,所以他想是不是可以用计算机来解决这个问题。假设你是明明,能完成这个任务吗?原创 2017-03-23 17:05:49 · 1097 阅读 · 0 评论