摘要: 题目描述 Treeland国有n个城市,这n个城市连成了一颗树,有n-1条道路连接了所有城市。每条道路只能单向通行。现在政府需要决定选择哪个城市为首都。假如城市i成为了首都,那么为了使首都能到达任意一个城市,不得不将一些道路翻转方向,记翻转道路的条数为k。你的任务是找到所有满足k最小的首都。 输入输 阅读全文
posted @ 2018-05-14 16:50 bbqub 阅读(377) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Farmer John has noticed that his cows often move between nearby fields. Taking this into account, he wants to plant enough grass in each of his f 阅读全文
posted @ 2018-05-14 16:04 bbqub 阅读(365) 评论(0) 推荐(0) 编辑