Prim全wa求助

P3366 【模板】最小生成树

有重边。。。我被坑了半小时,输入边时选小的边
by Tommyplayer @ 2021-01-17 21:43:16


```cpp cin>>p1>>p2>>value; if(graph[p1][p2] != inf) value = min(value,graph[p1][p2]); graph[p1][p2]=value; graph[p2][p1]=value; ```
by DengWangtao @ 2021-01-19 20:01:42


如果你用堆优化就不用考虑重边了
by xiaogao @ 2021-01-25 18:11:13


|