#580
Roy-Warshall
Se dă lista arcelor unui graf orientat. Construiți matricea drumurilor, folosind algoritmul lui Roy-Warshall.
Problema | Roy-Warshall | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #34417883 | Utilizator | |
Fișier | roy-warshall.c | Dimensiune | 601 B |
Data încărcării | 01 Februarie 2022, 17:02 | Scor / rezultat | Eroare de compilare |
roy-warshall.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token include <bits/stdc++.h> ^ roy-warshall.c: In function 'Warshall': roy-warshall.c:6:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int k = 1; k <= n; ++k) ^ roy-warshall.c:6:5: note: use option -std=c99 or -std=gnu99 to compile your code roy-warshall.c:7:9: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 1; i <= n; ++i) ^ roy-warshall.c:8:13: error: 'for' loop initial declarations are only allowed in C99 mode for (int j = 1; j <= n; ++j) ^ roy-warshall.c: In function 'main': roy-warshall.c:14:5: error: 'cin' undeclared (first use in this function) cin >> n >> m; ^ roy-warshall.c:14:5: note: each undeclared identifier is reported only once for each function it appears in roy-warshall.c:16:5: error: 'for' loop initial declarations are only allowed in C99 mode for(int i = 1 ; i <= m ; i++) ^ roy-warshall.c:22:14: error: redeclaration of 'x' with no linkage for (int x = 1; x <= n; ++x) ^ roy-warshall.c:15:9: note: previous declaration of 'x' was here int x, y; ^ roy-warshall.c:22:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int x = 1; x <= n; ++x) ^ roy-warshall.c:24:9: error: 'for' loop initial declarations are only allowed in C99 mode for (int y = 1; y <= n; ++y) ^ roy-warshall.c:25:13: error: 'cout' undeclared (first use in this function) cout << a[x][y] << ' '; ^ roy-warshall.c:28:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Roy-Warshall 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ă.