#589
Roy-Floyd
Se dă un graf orientat ponderat cu n
noduri și m
arce – în care fiecare arc are asociat un cost, număr natural strict pozitiv. Folosind algoritmul Roy-Floyd, construiți matricea costurilor minime.
Problema | Roy-Floyd | Operații I/O |
roy-floyd.in /roy-floyd.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #29572391 | Utilizator | |
Fișier | roy-floyd.c | Dimensiune | 2.14 KB |
Data încărcării | 10 Mai 2021, 11:23 | Scor / rezultat | Eroare de compilare |
roy-floyd.c: In function 'initializare_graf': roy-floyd.c:16:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < n; i++) ^ roy-floyd.c:16:5: note: use option -std=c99 or -std=gnu99 to compile your code roy-floyd.c:18:14: error: redefinition of 'i' for (int i = 0; i < n; i++) ^ roy-floyd.c:16:14: note: previous definition of 'i' was here for (int i = 0; i < n; i++) ^ roy-floyd.c:18:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < n; i++) ^ roy-floyd.c:20:14: error: redefinition of 'i' for (int i = 0; i < n; i++){ ^ roy-floyd.c:18:14: note: previous definition of 'i' was here for (int i = 0; i < n; i++) ^ roy-floyd.c:20:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < n; i++){ ^ roy-floyd.c:21:9: error: 'for' loop initial declarations are only allowed in C99 mode for (int j = i + 1; j < n; j++) ^ roy-floyd.c: In function 'main': roy-floyd.c:47:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < m; i++){ ^ roy-floyd.c:53:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int k = 0; k < n; k++){ ^ roy-floyd.c:54:9: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < n; i++){ ^ roy-floyd.c:55:13: error: 'for' loop initial declarations are only allowed in C99 mode for (int j = 0; j < n; j++){ ^ roy-floyd.c:67:14: error: redefinition of 'i' for (int i = 0; i < n; i++){ ^ roy-floyd.c:47:14: note: previous definition of 'i' was here for (int i = 0; i < m; i++){ ^ roy-floyd.c:67:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < n; i++){ ^ roy-floyd.c:68:9: error: 'for' loop initial declarations are only allowed in C99 mode for (int j = 0; j < n; j++){ ^ roy-floyd.c:41:11: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf(f_in, "%d %d", &n, &m); ^ roy-floyd.c:48:15: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf(f_in, "%d %d %d", &x, &y, &c); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Roy-Floyd face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.