![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
栈与队列的应用
大橘为重eleven
每天都因为自己太菜了而自闭
展开
-
简单计算器
题目描述:读入一个只包含 +, -, *, / 的非负整数计算表达式,计算该表达式的值。输入:测试输入包含若干测试用例,每个测试用例占一行,每行不超过200个字符,整数和运算符之间用一个空格分隔。没有非法表达式。当一行中只有0时输入结束,相应的结果不要输出。输出:对每个测试用例输出1行,即该表达式的值,精确到小数点后2位。样例输入:1 + 24 + 2 * 5 - 7 / 110...原创 2019-08-07 11:20:52 · 160 阅读 · 0 评论 -
POJ3169_Layout(差分约束)
题目描述:Like everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1…N standing along a straight line waiting for feed. The cows ...原创 2019-08-21 19:41:22 · 120 阅读 · 0 评论 -
poj3159 Candies(差分约束,最短路)
题目描述:During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. A...原创 2019-08-21 19:34:09 · 155 阅读 · 0 评论 -
Fence Repair
题目描述:Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, each having some integer length Li (1...原创 2019-08-07 20:03:55 · 144 阅读 · 0 评论 -
看病要排队
题目描述:看病要排队这个是地球人都知道的常识。不过经过细心的0068的观察,他发现了医院里排队还是有讲究的。0068所去的医院有三个医生(汗,这么少)同时看病。而看病的人病情有轻重,所以不能根据简单的先来先服务的原则。所以医院对每种病情规定了10种不同的优先级。级别为10的优先权最高,级别为1的优先权最低。医生在看病时,则会在他的队伍里面选择一个优先权最高的人进行诊治。如果遇到两个优先权一样的...原创 2019-08-07 19:57:00 · 147 阅读 · 0 评论 -
Stones
题目描述:Because of the wrong status of the bicycle, Sempr begin to walk east to west every morning and walk back every evening. Walking may cause a little tired, so Sempr always play some games this tim...原创 2019-08-07 19:45:01 · 144 阅读 · 0 评论 -
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 ...原创 2019-08-07 19:38:53 · 169 阅读 · 0 评论 -
约瑟夫问题No.2
题目描述:n 个小孩围坐成一圈,并按顺时针编号为1,2,…,n,从编号为 p 的小孩顺时针依次报数,由1报到m ,当报到 m 时,该小孩从圈中出去,然后下一个再从1报数,当报到 m 时再出去。如此反复,直至所有的小孩都从圈中出去。请按出去的先后顺序输出小孩的编号。输入:每行是用空格分开的三个整数,第一个是n,第二个是p,第三个是m (0 < m,n < 300)。最后一行是:0...原创 2019-08-07 19:32:31 · 221 阅读 · 0 评论 -
Bad Hair Day
题目描述: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 t...原创 2019-08-07 19:23:34 · 348 阅读 · 0 评论 -
愚人节的礼物
题目描述:四月一日快到了,Vayko想了个愚人的好办法——送礼物。嘿嘿,不要想的太好,这礼物可没那么简单,Vayko为了愚人,准备了一堆盒子,其中有一个盒子里面装了礼物。盒子里面可以再放零个或者多个盒子。假设放礼物的盒子里不再放其他盒子。用()表示一个盒子,B表示礼物,Vayko想让你帮她算出愚人指数,即最少需要拆多少个盒子才能拿到礼物。输入:本题目包含多组测试,请处理到文件结束。每组测...原创 2019-08-07 19:01:11 · 178 阅读 · 0 评论 -
ACboy needs your help again!
题目描述:ACboy 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原创 2019-08-07 18:54:49 · 157 阅读 · 0 评论 -
find the longest of the shortest
题目描述:Marica is very angry with Mirko because he found a new girlfriend and she seeks revenge.Since she doesn’t live in the same city, she started preparing for the long journey.We know for every road...原创 2019-08-21 20:25:32 · 296 阅读 · 0 评论