
算法练习,栈和队列
文章平均质量分 85
hubayi31072
这个作者很懒,什么都没留下…
展开
-
H - Array
点击打开链接Vitaly has an array of n distinct integers. Vitaly wants to divide this array into three non-empty sets so as the following conditions hold:The product of all numbers in the first set原创 2017-07-25 16:16:27 · 389 阅读 · 0 评论 -
G - 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原创 2017-07-25 17:11:53 · 243 阅读 · 0 评论 -
A - 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 :(. As a smart ACMer, you want to get ACboy ou原创 2017-07-25 20:26:42 · 264 阅读 · 0 评论 -
B - 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 fast原创 2017-07-25 20:32:30 · 348 阅读 · 0 评论 -
F - 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原创 2017-07-25 22:22:02 · 187 阅读 · 0 评论 -
E - 寻找大富翁
点击打开链接浙江桐乡乌镇共有n个人,请找出该镇上的前m个大富翁.Input输入包含多组测试用例. 每个用例首先包含2个整数n(0n和m同时为0时表示输入结束.Output请输出乌镇前m个大富翁的财产数,财产多的排前面,如果大富翁不足m个,则全部输出,每组输出占一行.Sample Input3 12 5 -15 31 2 3 4 50 0原创 2017-07-25 22:57:24 · 337 阅读 · 0 评论 -
D - 看病要排队
点击打开链接看病要排队这个是地球人都知道的常识。 不过经过细心的0068的观察,他发现了医院里排队还是有讲究的。0068所去的医院有三个医生(汗,这么少)同时看病。而看病的人病情有轻重,所以不能根据简单的先来先服务的原则。所以医院对每种病情规定了10种不同的优先级。级别为10的优先权最高,级别为1的优先权最低。医生在看病时,则会在他的队伍里面选择一个优先权最高的人进行诊治。如果原创 2017-07-26 00:37:38 · 358 阅读 · 0 评论