上一页 1 ··· 7 8 9 10 11 12 13 14 15 16 下一页
摘要: Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of 阅读全文
posted @ 2017-08-30 16:39 Zireael 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Saruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes seeing stone 阅读全文
posted @ 2017-08-28 20:40 Zireael 阅读(179) 评论(0) 推荐(0) 编辑
摘要: FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arranges his cows in a line 阅读全文
posted @ 2017-08-28 19:35 Zireael 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Description 可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定能将她救出。  阅读全文
posted @ 2017-08-26 13:43 Zireael 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 题意: 在平面上有n个点,要让所有n个点都连通,所以你要构造一些边来连通他们,连通的费用等于两个端点的欧几里得距离的平方。另外还可以选择q个套餐,可以购买,套餐内的所有点将会被连通。求最小花费。 题解: 如果不选择套餐的话,就是裸的MST。现在有了套餐可以选择,可以选择多个,那么就把它们(套餐里的点 阅读全文
posted @ 2017-08-22 14:24 Zireael 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 题意: 有多个供电站和村庄,问最少需要多少花费可以使所有村庄通上电。 题解: 刚开始不知道该怎么做,后来想了想,直接把供电站先加入到最小生成树里,(供电站之间的边权值为0)。很简单,裸题。 阅读全文
posted @ 2017-08-21 16:58 Zireael 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 题意: 求图中的最小生成树和次小生成树。 题解: 一种容易想到的方法是枚举删除最小生成树上的边,再求最小生成树。用kruskal这种算法的复杂度为O(n*elog2e),当图比较稠密时,复杂度接近O(n^3)。 但有一种更简单的方法:先求最小生成树T,枚举添加不在T中的边,则添加后一定会形成环。找到 阅读全文
posted @ 2017-08-20 17:00 Zireael 阅读(310) 评论(0) 推荐(0) 编辑
摘要: Description The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication te 阅读全文
posted @ 2017-08-20 14:06 Zireael 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Given an undirected weighted graph G, you should find one of spanning trees specified as follows. The graph G is an ordered pair (V, E), where V is a 阅读全文
posted @ 2017-08-19 11:18 Zireael 阅读(308) 评论(0) 推荐(0) 编辑
摘要: Advanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furniture, or for bricks. The com 阅读全文
posted @ 2017-08-18 15:58 Zireael 阅读(214) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 16 下一页