prim
vis[],map[][],
for i=1 to n ; low[i]=map[1][i];
for i =1 to n-1;
{
min=1000000;
for j=2 to n;
if(!vis[j]&&low[j]<min)
{min=low[j]; t=j;}
ans+=min;vis[t]=1;
for j=2to n;
{if(!vis[j]&&low[j]>map[t][j])
low[j]=map[t][j];}
}
k....
father[], struct edge{int x,y,w;}
for i =1 to n ;father[i]=i;
sort(e,e+en)
for i=1 to n-1;
{if(getfather(e[i].x)!=getfather(e[i].y))
ans+=e[i].w;
father[e[i].x]=getfather(e[i].y);}
struct Point{
int x,y,value;
***** bool operator<(const Point &aa)const{
return value<aa.value;
} *******这是个什么鬼........
}point[20000];
联络员 k...算法是在输入的时候就把必须的加上,然后排序照样做
但排序是个什么鬼
第三题 字母可以用switch换成数字 也可以强制转换x=int(a-‘A’)应该是这么换的吧
只是我坚定的相信我没答案一定是输入语句的问题