摘要: 题目链接:https://ac.nowcoder.com/acm/contest/3566/B 思路:一条路可把图分为左右两部分。 l_ci, l_peo, r_ci, r_peo, w 分别为左边城市数和人数,右边城市数和人数,该路的费用。 我们知道,左边的人要去右边的r_ci个城市,右边的人要去 阅读全文
posted @ 2020-02-13 00:59 SummerMingQAQ 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://ac.nowcoder.com/acm/contest/3566/E 思路:tarjan缩点,桥重建图,dfs跑树的直径。 1 #include <iostream> 2 #include <cstdio> 3 #include <vector> 4 #include <a 阅读全文
posted @ 2020-02-13 00:48 SummerMingQAQ 阅读(175) 评论(0) 推荐(0) 编辑