摘要:
In Search of Gold 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6769 解题思路:要求最大值最小,就采用二分的方法来做,最小就是0,最大就是所有边取最大值然后二分这个直径。 但是我们如何求树上的直径使其最大最小,考虑dp的方法来做, 阅读全文
摘要:
题目链接:https://codeforces.com/contest/1343/problem/D、 解题思路:差分来借,具体看这里 #include<bits/stdc++.h> using namespace std; const int maxn=4e5+10; const int inf= 阅读全文