#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 | #49893408 | Utilizator | |
Fișier | roy-warshall.cpp | Dimensiune | 770 B |
Data încărcării | 19 Martie 2024, 09:38 | Scor / rezultat | Eroare de compilare |
roy-warshall.cpp: In function 'void BF(int)': roy-warshall.cpp:7:5: error: 'P' was not declared in this scope P[i]=1; ^ roy-warshall.cpp:8:5: error: 'D' was not declared in this scope D[0]=0; ^ roy-warshall.cpp:9:5: error: 'Q' was not declared in this scope Q.push(i); ^ roy-warshall.cpp:14:24: error: 'n' was not declared in this scope for(int j=1;j<=n;j++) ^ roy-warshall.cpp:15:25: error: 'A' was not declared in this scope if(!P[j] && A[i][j]==1) ^ roy-warshall.cpp:20:13: error: expected ';' before '}' token } ^ roy-warshall.cpp: In function 'int main()': roy-warshall.cpp:27:10: error: 'n' was not declared in this scope cin>>n>>m; ^ roy-warshall.cpp:27:13: error: 'm' was not declared in this scope cin>>n>>m; ^ roy-warshall.cpp:31:9: error: 'A' was not declared in this scope A[x][y]=1; ^ roy-warshall.cpp:35:16: error: 'A' was not declared in this scope if(A[i][j]==0) ^ roy-warshall.cpp:35:21: error: 'j' was not declared in this scope if(A[i][j]==0) ^ roy-warshall.cpp:40:19: error: 'A' was not declared in this scope cout<<A[i][j]<<" "; ^ roy-warshall.cpp:26:13: warning: unused variable 'k' [-Wunused-variable] int x,y,k; ^
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ă.