摘要: 这道题和poj的食物链很像,要在路径压缩的过程中进行坐标的位置处理,要保存的是当前节点相对于父节点的相对坐标位置。合并的时候要考虑清楚两个父节点之间的坐标关系是什么View Code 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #define N 40005 5 using namespace std; 6 struct node 7 { 8 int p; 9 int x,y;10 int r;11 int xd,yd;12 };13 int n;14 node f[N];15 阅读全文
posted @ 2012-05-22 23:09 zhenhai 阅读(186) 评论(0) 推荐(0)