int n; int d[MAX_N + 1][MAX_N + 1]; void Floyd() { for(register int k = 1; k <= n; ++k) { for(register int i = 1; i <= n; ++i) { for(register int j = 1; j <= n; ++j) { d[i][j] = min(d[i][j], d[i][k] + d[k][j]; } } } return; }
2024-03-31 10:56:10
int n; int d[MAX_N + 1][MAX_N + 1]; void Floyd() { for(register int k = 1; k <= n; ++k) { for(register int i = 1; i <= n; ++i) { for(register int j = 1; j <= n; ++j) { d[i][j] = min(d[i][j], d[i][k] + d[k][j]; } } } return; }