题目链接: C. Nearest vectors time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given the set of vectors on the plane, each of them starting at the origin. Your task is to find a pair of…
Partial Tree Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/598/problem/C Description You are given the set of vectors on the plane, each of them starting at the origin. Your task is to find a pair of vectors with the mini…
传送门: http://codeforces.com/problemset/problem/598/C Nearest vectors time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given the set of vectors on the plane, each of them starting at…
C. Paint Tree time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given a tree with n vertexes and n points on a plane, no three points lie on one straight line. Your task is to paint…
题目链接 Paint Tree 给你一棵n个点的树和n个直角坐标系上的点,现在要把树上的n个点映射到直角坐标系的n个点中,要求是除了在顶点处不能有线段的相交. 我们先选一个在直角坐标系中的最左下角的点,把根结点放到这个点中,然后对剩下的点进行极角排序,按逆时顺序一个个塞进来,类似地递归处理. 这样就满足了题意. #include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i(a); i <= (b…