codeforces1003E. Tree Constructing
题目链接:http://codeforces.com/contest/1003/problem/E
题解:
先特判k=1以及D>n-1的情况.然后根据D的奇偶性,奇数时根的有一颗子树的深度跟其他子树不一样。dfs构造时特判一下即可。
#include"bits/stdc++.h"
using namespace std;
const int MX = 4e5+7;
int n,...
原创
2018-07-17 20:07:22 ·
114 阅读 ·
0 评论