随笔分类 -  DFS(深度优先搜索)

摘要:完美正方形 如果一些边长互不相同的正方形,可以恰好拼出一个更大的正方形,则称其为完美正方形。历史上,人们花了很久才找到了若干完美正方形。比如:如下边长的22个正方形 2 3 4 6 7 8 12 13 14 15 16 17 18 21 22 23 24 26 27 28 50 60 如【图1.pn 阅读全文
posted @ 2019-04-11 21:54 suvvm 阅读(917) 评论(1) 推荐(1)
摘要:Counting Leaves A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Specifi 阅读全文
posted @ 2019-04-02 21:04 suvvm 阅读(551) 评论(0) 推荐(0)
摘要:Emergency As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected 阅读全文
posted @ 2019-03-29 21:14 suvvm 阅读(685) 评论(0) 推荐(0)
摘要:Deepest Root A graph which is connected and acyclic can be considered a tree. The hight of the tree depends on the selected root. Now you are supposed 阅读全文
posted @ 2019-01-25 15:31 suvvm 阅读(389) 评论(0) 推荐(0)
摘要:Public Bike Management There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One m 阅读全文
posted @ 2019-01-01 19:42 suvvm 阅读(549) 评论(0) 推荐(0)