摘要: 算法:次小生成树 描述 南将军率领着许多部队,它们分别驻扎在N个不同的城市里,这些城市分别编号1~N,由于交通不太便利,南将军准备修路。 现在已经知道哪些城市之间可以修路,如果修路,花费是多少。 现在,军师小工已经找到了一种修路的方案,能够使各个城市都联通起来,而且花费最少。 但是,南将军说,这个修 阅读全文
posted @ 2016-03-26 17:17 (慎独) 阅读(422) 评论(0) 推荐(0) 编辑
摘要: 算法:广搜+优先队列 描述 Many of us had played the game "Battle city" in our childhood, and some people (like me) even often play it on computer now. What we... 阅读全文
posted @ 2016-03-22 10:33 (慎独) 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 算法:广搜; 描述 You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be fille... 阅读全文
posted @ 2016-03-21 18:45 (慎独) 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 算法:搜索 描述 One day,Tom’s girlfriend give him an array A which contains N integers and asked him:Can you choose some integers from the N integers and t... 阅读全文
posted @ 2016-03-21 13:31 (慎独) 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 算法:搜索+优先队列 描述 在一个山沟里,姐弟俩同时考上了大学。但由于家里拮据,所以这并不是什么好消息。父亲对孩子说:我就是砸锅卖铁也要把你们姐俩供出来。 当时的姐姐已经决定放弃上学的机会。 没想到第二天天还没亮,弟弟就偷偷带著几件破衣服和几个乾巴馒头走了,在姐姐枕边留下一个纸条: 姐,你别愁... 阅读全文
posted @ 2016-03-21 12:53 (慎独) 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 算法:搜索; In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation Fn = Fn-1 + Fn-2 with seed values F1 = 1; F... 阅读全文
posted @ 2016-03-19 16:58 (慎独) 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 算法:搜索+优先队列+(递归输出结果) The Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has to rescue our pretty Princess. Now he gets into ... 阅读全文
posted @ 2016-03-17 21:26 (慎独) 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 算法:广搜+位运算; 题目描述 Ignatius再次被魔王抓走了(搞不懂他咋这么讨魔王喜欢)…… 这次魔王汲取了上次的教训,把Ignatius关在一个n*m的地牢里,并在地牢的某些地方安装了带锁的门,钥匙藏在地牢另外的某些地方。刚开始Ignatius被关在(sx,sy)的位置,离开地牢的门在(... 阅读全文
posted @ 2016-03-16 21:03 (慎独) 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 算法:搜索 题目描述 Ignatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会. 魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的矩阵,刚开始Ignatius被关在(0,0,0)的位置,离开城堡的门在(A-1,B-1,C-1)的位置,现在知... 阅读全文
posted @ 2016-03-16 18:04 (慎独) 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 算法:搜索 题目描述 今天是阴历七月初五,acm队员zb的生日。zb正在和C小加、never在武汉集训。他想给这两位兄弟买点什么庆祝生日,经过调查,zb发现C小加和never都很喜欢吃西瓜,而且一吃就是一堆的那种,zb立刻下定决心买了一堆西瓜。当他准备把西瓜送给C小加和never的时候,遇到了一... 阅读全文
posted @ 2016-03-15 20:46 (慎独) 阅读(178) 评论(0) 推荐(0) 编辑