/ Vijos / 讨论 / 家族 /

Why无输出?

#include

using namespace std;

const int N=5001;

int father[N],n,m,j;

int find(int x)

{if(father[x]!=-1)

return father[x]=find(father[x]);

else

return x;

}

void out(int x,int y)

{int t1,t2;

t1=find(x);

t2=find(y);

if(t1==t2)

coutt2;

merge(t1,t2); }

for(i=1;i>t1>>t2;

out(t1,t2);}

return 00;

}

1 条评论

  • @ 2010-07-22 00:04:55

    不用加freopen

    vijos的io是屏幕io不用加freopen

  • 1

信息

ID
1034
难度
4
分类
数据结构 | 并查集 点击显示
标签
(无)
递交数
9368
已通过
3839
通过率
41%
被复制
15
上传者