摘要: 并查集,还有判断两线段是否相交。我直接用面积的方法判断的,貌似效率略低,但是Ac还是可以的,代码如下:#include <iostream>using namespace std;int root[1001];int num[1001];int find(int x){ return root[x]?(root[x]=find(root[x])):x;}void u(int x,int y){ int a=find(x); int b=find(y); if(a!=b) num[root[b]=a]+=num[b];}struct p{ doubl... 阅读全文
posted @ 2013-03-26 21:52 SF-_- 阅读(241) 评论(0) 推荐(0) 编辑