http://codeforces.com/contest/761/problem/E
给出一颗树,要求在坐标系中用平行于坐标轴的线描绘出来。
要求边不能相交,而且点的坐标唯一。
注意到2^1 + 2^2 + ….. + 2^n = 2^(n + 1) - 1
那就是说,如果第一条边的边长是2^(n + 1),那么后面的边选2^n 、 2^(n - 1)等等,相加起来也不会越过第一条,所以也就不会相交。
#include
#include
#include
#include
#include
#include
#define IOS ios::sync_with_stdio(false)
using namespace std;
#define inf (0x3f3f3f3f)
typedef long long int LL;
#include
#include
#include
#include
#include
int main() {
#ifdef local
freopen("data.txt", "r", stdin);
// freopen("data.txt", "w", stdout);
#endif
work();
return ;
}