变量名开得不好么?
#include<stdio.h>
#define MAX 0xffffffff
#define UI unsigned int
typedef struct E
{
UI to,k;
};
typedef struct MNode
{
UI en;
E x[500];
};
UI n,e,A[500],R;
MNode map[500];
int main()
{
//freopen("R193.in","r",stdin);freopen("R193.out","w",stdout);
UI i,j,a,b,k;
scanf("%u%u",&n,&e);
for(i=1;i<=n;i++) A[i]=MAX;
for(i=0;i<e;i++)
{
scanf("%u%u%u",&a,&b,&k);
#define thse(which) map[which].x[map[which].en]
thse(a).to=b;
thse(b).to=a;
thse(a).k=thse(b).k=k;
map[a].en++;
map[b].en++;
}
i=1;A[1]=0;
for(k=1;k<n;k++)
{
a=MAX;
for(j=0;j<map[i].en;j++)
if (map[i].x[j].k<A[map[i].x[j].to]&&A[map[i].x[j].to])
A[map[i].x[j].to]=map[i].x[j].k;
a=MAX;
for(j=1;j<=n;j++) if (A[j]<a&&A[j]) {a=A[j];i=j;}
R+=a;
A[i]=0;
}
printf("%u",R);
return 0;
}
上面出现了 net
虽然中间有一个空格,但都不行 :(
不知道 rqnoj 的正则式是怎么写的,搞成这个样子
很好,很强大
