6个TLE 求助大佬剪枝优化

P3366 【模板】最小生成树

[评测记录](https://www.luogu.com.cn/record/40065501)[https://www.luogu.com.cn/record/40065501](https://www.luogu.com.cn/record/40065501)
by Meteorshower_Y @ 2020-10-18 20:14:22


显然,这段代码是O(n^3)的 因此你需要Prim/Kruskal算法来优化
by donghanwen1225 @ 2020-10-18 20:16:52


~~而且您这种最小生成树的写法我从来没见过~~
by donghanwen1225 @ 2020-10-18 20:17:49


@[Meteorshower_Y](/user/239164) 您这是啥写法?
by MatrixCascade @ 2020-10-18 20:41:04


@[Illusory_](/user/154101) 在百度上看了最小生成树的画法,按照上面的做法打成了代码[图示网址](https://img-blog.csdn.net/20180626114221407?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1haWjIyMjI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)[https://img-blog.csdn.net/20180626114221407?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1haWjIyMjI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70](https://img-blog.csdn.net/20180626114221407?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1haWjIyMjI=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)
by Meteorshower_Y @ 2020-10-18 20:46:03


@[Illusory_](/user/154101) 具体是什么写法我也不太清楚(捂脸.jpg)
by Meteorshower_Y @ 2020-10-18 20:47:18


@[Illusory_](/user/154101) 抱歉上面的连接看不了,下面的这个应该可以[https://cdn.luogu.com.cn/upload/image_hosting/hvr1mljj.png](https://cdn.luogu.com.cn/upload/image_hosting/hvr1mljj.png)
by Meteorshower_Y @ 2020-10-18 20:50:18


@[donghanwen1225](/user/153687) 有一小半算是自创的吧
by Meteorshower_Y @ 2020-10-18 20:51:03


谢谢,我看看。
by MatrixCascade @ 2020-10-18 20:51:14


@[donghanwen1225](/user/153687) 谢谢您的提醒
by Meteorshower_Y @ 2020-10-18 20:51:29


| 下一页