传送门
神奇的spfa
#include <queue> #include <cstdio> #include <cstring> #include <iostream> #define N 1010 #define max(x, y) ((x) > (y) ? (x) : (y)) int n, mx, my; int dis[N][N]; bool map[N][N], vis[N][N]; int dx[4] = , dy[4] = ; struct node }; std::queue <node> q; inline int read() int main() while(!q.empty()) } } } printf("%d\n", dis[1][1]); return 0; }
上一篇:[Vijos1067]Warcraft III 守望者的烦恼(DP + 矩阵优化)
下一篇:链接
spfa 最短路









