摘要: 题意: 题解:同Gym102222G(链接),把size数组更改一下即可。 #include <bits/stdc++.h> using namespace std; const int maxn=1e5+5; const long long inf=1e17+5; int n, m, k; int 阅读全文
posted @ 2019-11-28 11:38 N_Yokel 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 链接:https://codeforces.com/gym/102222/problem/G 题意:给出一个树,从所有的叶子节点中选出m个节点,使得这m个节点间的 sigma(任意2点间的距离)最小。求最小的sigma。 n<1e5, k<100。 题解:求任意2点间的距离和, 可考虑贡献,考虑每条 阅读全文
posted @ 2019-11-28 11:31 N_Yokel 阅读(188) 评论(0) 推荐(0) 编辑