struct E{
int to,w,next;
}edges[N];
// every edge in array edges actually saves an edge and it’s end.
//there is a pool of edge with used edge and unused edges, before the index of tot,the edges are used while after the index of tot, the edges are not used
int tot,head[N];
//加边函数(add an edge from a to b) insert into the head
void add_edge(int a,int b,int w){
edge[tot].to = b;
edge[tot].w = w;
edge[tot].next = head[a];
head[a] = tot++;
}
void traverse(int a){
for(int i =head[a];~i;i = edge[i].next){
int v= edge[i].to;
int w = edge[i].w;
}
}