摘要:
#include<bits/stdc++.h> using namespace std; using i64 = long long; template<class T> constexpr T power(T a, i64 b) { T res = 1; for (; b; b /= 2, a * 阅读全文
摘要:
解题:贪心 很明显越靠近越好。随便从一个点出发,按照翻的排列方式来选择和父亲链接还是和兄弟链接。记得每次加2哦~~~~ 具体代码: #include<bits/stdc++.h> using namespace std; #define int long long const int N = 1e5 阅读全文