摘要: 题目 大致题意 把指定的人从同一出口送出车外,且同一位置不能同时有两个人,求所需的最短时间。 分析 第一感觉就是利用贪心思想解决问题,但是这道题的数据范围用模拟的话肯定是会爆掉的,所以这是不可取的。我们可以反过来想,把所有人从出口送回原位,然后根据距离进行降序排序,离出口远的人先进,其他人后进,这样 阅读全文
posted @ 2020-04-11 15:18 Vocanda 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 题目 Input The first line contains an integer n (2≤n≤3000), the number of gangs in the network. Each of the next n−1 lines contains integers ui and vi ( 阅读全文
posted @ 2020-04-11 14:44 Vocanda 阅读(171) 评论(0) 推荐(0) 编辑