Download benchmarks/Algorithms/Floyd_adjacency_matrix_2Darray/solution.c from PV-SJTU/PV-Bench: direct link, hf CLI and curl.
- Browser
- Download file 480 Bytes
-
https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/Floyd_adjacency_matrix_2Darray/solution.c
- Command line
-
hf download hf://datasets/PV-SJTU/PV-Bench/benchmarks/Algorithms/Floyd_adjacency_matrix_2Darray/solution.c
-
curl -L -o solution.c https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/Floyd_adjacency_matrix_2Darray/solution.c
480 Bytes
| void floyd_adjacency_matrix_2Darray(int n, int dist[MAXN][MAXN]) | |
| { | |
| int k, i, j; | |
| for (k = 0; k < n; ++k) { | |
| for (i = 0; i < n; ++i) { | |
| for (j = 0; j < n; ++j) { | |
| if (dist[i][k] < INF && | |
| dist[k][j] < INF && | |
| dist[i][k] + dist[k][j] < dist[i][j]) { | |
| dist[i][j] = dist[i][k] + dist[k][j]; | |
| } | |
| } | |
| } | |
| } | |
| } | |