Download uva_cpp_clean/10048/10048-20.cpp from slayone/uva_spoj_raw: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/datasets/slayone/uva_spoj_raw/resolve/main/uva_cpp_clean/10048/10048-20.cpp
- Command line
-
hf download hf://datasets/slayone/uva_spoj_raw/uva_cpp_clean/10048/10048-20.cpp
-
curl -L -o 10048-20.cpp https://huggingface.co/datasets/slayone/uva_spoj_raw/resolve/main/uva_cpp_clean/10048/10048-20.cpp
1.12 kB
| int decibel[MAX][MAX]; | |
| int main() | |
| { | |
| int C, S, Q, nCase = 1; | |
| bool flag = false; | |
| while( scanf("%d %d %d", &C, &S, &Q)==3 && (C || S || Q) ) | |
| { | |
| for(int i=0 ; i<MAX ; i++) | |
| for(int j=0 ; j<MAX ; j++) decibel[i][j] = INF; | |
| for(int i=1 ; i<=S ; i++) | |
| { | |
| int c1, c2, d; | |
| scanf("%d %d %d", &c1, &c2, &d); | |
| decibel[c1][c2] = decibel[c2][c1] = d; | |
| } | |
| for(int k=1 ; k<=C ; k++) | |
| for(int i=1 ; i<=C ; i++) | |
| for(int j=1 ; j<=C ; j++) | |
| decibel[i][j] = Min(decibel[i][j], Max(decibel[i][k], decibel[k][j])); | |
| if( flag ) printf("\n"); | |
| flag = true; | |
| printf("Case #%d\n", nCase); | |
| for(int i=1 ; i<=Q ; i++) | |
| { | |
| int c1, c2; | |
| scanf("%d %d", &c1, &c2); | |
| if( decibel[c1][c2]==INF ) printf("no path\n"); | |
| else printf("%d\n", decibel[c1][c2]); | |
| } | |
| nCase++; | |
| } | |
| return 0; | |
| } | |