825
CodeForces 825G Tree Queries
[洛谷传送门](https://www.luogu.com.cn/problem/CF825G "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/825/G "CF 传送门") 模拟赛赛时做法。 看到查询路径点权最小值,想到建重构 ......
「题解」Codeforces 825G Tree Queries
点权转边权,把边权设为两个端点的 $\min$,然后发现询问 $x$ 的答案,就是询问 $x$ 与所有黑点的虚树,边权的 $\min$ 是多少。假设要判定答案是否 $\geq k$,那么就是询问 $x$ 只经过 $\geq k$ 是否能到达所有黑点,于是想到建立 Kruskal 重构树,那么 $x$ ......
Codeforces Round 825 (Div. 2)——B
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define endl "\n" inline int gcd(int a, int b) { return b > 0 ? gcd(b, a % b) : a; ......