摘要:
一、动态规划(背包问题) 问题1:Bone Collector(二维) Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect var 阅读全文
摘要:
问题:Red and Black There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. 阅读全文
摘要:
一、Dijkstra算法 问题一: 输入: 6 8 00 1 10 3 40 4 41 3 22 5 13 2 23 4 34 5 3 输出: 0 1 5 3 4 6 代码: (1)邻接矩阵 #include<iostream> #include<algorithm> #include<queue> 阅读全文
摘要:
问题:How Many Tables Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at 阅读全文
摘要:
一、prim算法 问题:畅通工程 某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。 Input:测试输入包含若 阅读全文