
并查集
文章平均质量分 72
slw1slw
这个作者很懒,什么都没留下…
展开
-
hdu1558 几何处理 + 并查集
hdu1558 几何处理 + 并查集 ( 转)<br />题目:Segment set<br />分析:并查集。这题有两个关键点。<br />第一点:如何判断两条线段是否有交点。<br />第二点:快速查找某条线段所在集合里的线段条数,用并查集实现。<br />#include<stdio.h><br />#include<stdlib.h><br />#define NN 1004<br /><br />typedef struct node{<br /> double x, y;<br />转载 2010-12-30 16:32:00 · 339 阅读 · 0 评论 -
正整数分解程序(递归版)
<br />#include<stdio.h><br />#include<stdlib.h><br />#include<time.h><br />#include<conio.h><br />#define M 100<br />typedef unsigned int UINT;<br />UINT queue[M+1]={0};<br />int p(UINT n, UINT m, UINT pos);<br />UINT cnt=0; <br />int main()<br />{<br />转载 2011-01-14 11:14:00 · 1106 阅读 · 0 评论