杭电acm1233

[复制链接]
查看11 | 回复2 | 2010-12-24 08:29:46 | 显示全部楼层 |阅读模式
http://acm.hdu.edu.cn/showproblem.php?pid=1233
高手们,请帮帮忙找找哪里错了,我不要你们的ac代码,谢谢
请帮我找出来哪里错了,再次感谢
#include
#include
struct node
{

int x,y;

int z;
}shu[5002];
int p[105];
int findx(x)
{

int r;

r=x;

while(r!=p[r])

{

r=p[r];

}

return r;
}
int connect(x,y)
{

int q,w;

q=findx(x);

w=findx(y);

if(q!=w)

{

if(q>w)

{p[q]=w;}

else {p[w]=q;}

return 1;

}

else return 0;
}
int cmp(const void *aa,const void*bb)
{
if((*(struct node*)aa).z>(*(struct node*)bb).z)

return 1;

else if((*(struct node*)aa).z
#include
struct node
{int x,y;

int z;
}shu[5002];
int p[150];
int findx(int x)
{

int r;

r=x;

while(r!=p[r])

{

r=p[r];

}
p[r]=r;

return r;
}
int connect(int x,int y)
{

int q,w;

q=findx(x);

w=findx(y);

if(q!=w)

{

if(q>w)

{p[q]=w;}

else {p[w]=q;}

return 1;

}

else return 0;
}
int cmp(const void *aa,const void*bb)
{

return((*(struct node*)aa).z-(*(struct node*)bb).z);


}
void main()
{

int n,t,i,sum,m;

while(scanf("%d",&n)!=EOF&&n)

{

t=(n-1)*n/2;

for(i=0;i#include#include#includeusing namespace std;int pre[105];struct node{int x1,x2;int cost;}D[5050];void Init(int n){int i;
回复

使用道具 举报

千问 | 2010-12-24 08:29:46 | 显示全部楼层
这是我在你基础上改的,你写得实在是太乱了,好好练练吧#include #include#include using namespace std;struct node{int x,y;
int z;}shu[50000];int p[50000];
回复

使用道具 举报

千问 | 2010-12-24 08:29:46 | 显示全部楼层
prim
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行