void addedge(long long from,long long to,long long dis)//入边链式前向星 
{
    num_edge++;//编号
    edge[num_edge].next=head[from];//把next值改为此边编号
    edge[num_edge].to=to;//to和dis分别为对应的终点和长度
    edge[num_edge].dis=dis;
    head[from]=num_edge;//把这个边的始点的编号的head值改为前一个边的编号(指向)
}

 

相关文章:

  • 2021-10-09
  • 2021-04-29
猜你喜欢
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
  • 2021-10-05
  • 2022-12-23
相关资源
相似解决方案