摘要: Description The cows have purchased a yogurt factory that makes world-famous Yucky Yogurt. Over the next N (1 <= N <= 10,000) weeks, the price of milk 阅读全文
posted @ 2017-07-21 17:41 爱国呐 阅读(588) 评论(0) 推荐(0) 编辑
摘要: Description Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He always wants to have one cow 阅读全文
posted @ 2017-07-21 16:38 爱国呐 阅读(267) 评论(0) 推荐(0) 编辑
摘要: poj 3253 Fence Repair 优先队列 Description Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds tha 阅读全文
posted @ 2017-07-21 16:19 爱国呐 阅读(507) 评论(0) 推荐(1) 编辑
摘要: Description To avoid unsightly burns while tanning, each of the C (1 ≤ C ≤ 2500) cows must cover her hide with sunscreen when they're at the beach. Co 阅读全文
posted @ 2017-07-21 15:49 爱国呐 阅读(343) 评论(0) 推荐(0) 编辑
摘要: 关于二叉树,基本操作都是在递归的基础上完成的,二叉树的层次遍历是队列实现。具体解释看代码 阅读全文
posted @ 2017-07-20 22:26 爱国呐 阅读(646) 评论(0) 推荐(0) 编辑
摘要: Description An abandoned country has n(n≤100000) villages which are numbered from 1 to n. Since abandoned for a long time, the roads need to be re-bui 阅读全文
posted @ 2017-07-20 21:53 爱国呐 阅读(711) 评论(0) 推荐(1) 编辑
摘要: 一.解释: 1.栈 栈是一种特殊的线性表。其特殊性在于限定插入和删除数据元素的操作只能在线性表的一端进行。如下所示: 结论:后进先出(Last In First Out),简称为LIFO线性表。 举个例子:你在洗碗把洗好的碗编号为1、2、、、n依次摞起来,1号在最下面,向上编号依次增加,然后再从上到 阅读全文
posted @ 2017-07-18 15:46 爱国呐 阅读(35413) 评论(2) 推荐(10) 编辑
摘要: 一.解释: 优先队列是队列的一种,不过它可以按照自定义的一种方式(数据的优先级)来对队列中的数据进行动态的排序,每次的push和pop操作,队列都会动态的调整,以达到我们预期的方式来存储。 例如,将元素5 3 2 4 6依次push到优先队列中,规定顺序为从大到小并输出,输出顺序为6 5 4 3 2 阅读全文
posted @ 2017-07-18 15:29 爱国呐 阅读(3297) 评论(0) 推荐(0) 编辑
摘要: Description A string of lowercase letters is calledalphabeticalif deleting zero or more of its letters can result inthealphabet string"abcdefghijklmno 阅读全文
posted @ 2017-07-18 14:23 爱国呐 阅读(363) 评论(0) 推荐(0) 编辑
摘要: Description In his memoir So, Anyway. . ., comedian John Cleese writes of the class di erence between his father(who was "middle-middle-middle-lower-m 阅读全文
posted @ 2017-07-15 16:53 爱国呐 阅读(516) 评论(0) 推荐(0) 编辑