void
add(
int
x,
int
y,
int
z){
//邻接表
e[tot].
from
=x;//头结点
e[tot].to=y;//尾结点
e[tot].w=z;//边权
e[tot].next=head[x];
head[x]=tot++;
}
void
add(
int
x,
int
y,
int
z){
//邻接表
e[tot].
from
=x;//头结点
e[tot].to=y;//尾结点
e[tot].w=z;//边权
e[tot].next=head[x];
head[x]=tot++;
}