#589
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 drumurilor 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 | #64404011 | Utilizator | |
| Fișier | roy-floyd.cpp | Dimensiune | 1.17 KB |
| Data încărcării | 05 Mai 2026, 12:41 | Scor/rezultat | Eroare de compilare |
roy-floyd.cpp:4:14: error: extended character “ is not valid in an identifier 4 | ifstream fin(“roy-floyd.in”); | ^ roy-floyd.cpp:4:25: error: extended character ” is not valid in an identifier 4 | ifstream fin(“roy-floyd.in”); | ^ roy-floyd.cpp:5:15: error: extended character “ is not valid in an identifier 5 | ofstream fout(“roy-floyd.out”); | ^ roy-floyd.cpp:5:26: error: extended character ” is not valid in an identifier 5 | ofstream fout(“roy-floyd.out”); | ^ roy-floyd.cpp:35:48: error: extended character ” is not valid in an identifier 35 | fout <<-1<<” “; | ^ roy-floyd.cpp:35:50: error: extended character “ is not valid in an identifier 35 | fout <<-1<<” “; | ^ roy-floyd.cpp:36:54: error: extended character ” is not valid in an identifier 36 | else fout <<a[i][j]<<” “; | ^ roy-floyd.cpp:36:56: error: extended character “ is not valid in an identifier 36 | else fout <<a[i][j]<<” “; | ^ roy-floyd.cpp:4:14: error: ‘“roy’ was not declared in this scope 4 | ifstream fin(“roy-floyd.in”); | ^~~~ roy-floyd.cpp:4:19: error: ‘floyd’ was not declared in this scope 4 | ifstream fin(“roy-floyd.in”); | ^~~~~ roy-floyd.cpp:5:15: error: ‘“roy’ was not declared in this scope 5 | ofstream fout(“roy-floyd.out”); | ^~~~ roy-floyd.cpp:5:20: error: ‘floyd’ was not declared in this scope 5 | ofstream fout(“roy-floyd.out”); | ^~~~~ roy-floyd.cpp: In function ‘int main()’: roy-floyd.cpp:26:20: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 26 | if(a[i][j]>a[i][k]+a | ^ roy-floyd.cpp:26:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 26 | if(a[i][j]>a[i][k]+a | ~~~~~~~^~~~~~~~~~ roy-floyd.cpp:26:37: error: expected ‘;’ before ‘if’ 26 | if(a[i][j]>a[i][k]+a | ^ | ; 27 | if(a[i][j]>a[i][k]+a[k][j]) | ~~ roy-floyd.cpp:26:27: warning: statement has no effect [-Wunused-value] 26 | if(a[i][j]>a[i][k]+a | ~~~~~~~^~~~~~~~~~ roy-floyd.cpp:29:29: error: expected primary-expression before ‘for’ 29 | for (int i=1; i<=n; i++) | ^~~ roy-floyd.cpp:28:53: error: expected ‘)’ before ‘for’ 28 | a[i][j]=a[i][k]+a[k][j]; | ^ | ) 29 | for (int i=1; i<=n; i++) | ~~~ roy-floyd.cpp:26:19: note: to match this ‘(’ 26 | if(a[i][j]>a[i][k]+a | ^ roy-floyd.cpp:26:17: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 26 | if(a[i][j]>a[i][k]+a | ^~ roy-floyd.cpp:29:43: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 29 | for (int i=1; i<=n; i++) | ^ roy-floyd.cpp:29:44: warning: statement has no effect [-Wunused-value] 29 | for (int i=1; i<=n; i++) | ~^~~ roy-floyd.cpp:29:52: error: expected ‘;’ before ‘)’ token 29 | for (int i=1; i<=n; i++) | ^ | ;
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ă.