请进来康康

学术版

$\huge\mathfrak{qaq}$
by yu__xuan @ 2019-06-26 09:49:31


$\text{求Dijkstra不加任何优化的板子(最好是邻接矩阵),qwq}$
by yu__xuan @ 2019-06-26 09:53:21


@[你听风在吼](/space/show?uid=122557)
by yu__xuan @ 2019-06-26 09:55:37


```cpp void dij() { memset(dis, 0x3f, sizeof dis); memset(vis, 0, sizeof vis); dis[1] = 0; for(int i = 1; i < n; i++) { int x = 0; for(int j = 1; j <= n; j++) if(!vis[j] && (x == 0 || dis[j] < dis[x])) x = j; vis[x] = 1; for(int j = 1; j <= n; j++) dis[j] = min(dis[j], dis[x] + g[x][j]); } } ```
by YingLi @ 2019-06-26 09:55:41


@[YingLi](/space/show?uid=116824) %%%
by yu__xuan @ 2019-06-26 09:56:20


$\text{多谢}$
by yu__xuan @ 2019-06-26 09:56:38


|