#146
Călinuţa tocmai a găsit o foaie de hârtie pe care este desenat un graf orientat aciclic cu N noduri şi M arce, fiecare arc având o distanţă de valoare întreagă. Dându-se N, M şi cele M arce cu distanţele dintre ele, trebuie să calculaţi pentru Călinuţa distanţa minimă dintre fiecare două noduri.
Grigore Moisil 2013
| Problema | graph | Operații I/O |
graph.in/graph.out
|
|---|---|---|---|
| Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #62049710 | Utilizator | |
| Fișier | graph.cpp | Dimensiune | 2.06 KB |
| Data încărcării | 05 Ianuarie 2026, 10:58 | Scor/rezultat | Eroare de compilare |
graph.cpp: In function 'void dfs(int)': graph.cpp:33:25: error: expected unqualified-id before '[' token for (pair<int, int> [v, cost] : G[u]) ^ graph.cpp:33:25: error: expected ';' before '[' token graph.cpp:33:26: error: 'v' was not declared in this scope for (pair<int, int> [v, cost] : G[u]) ^ graph.cpp:33:29: error: 'cost' was not declared in this scope for (pair<int, int> [v, cost] : G[u]) ^ graph.cpp: In lambda function: graph.cpp:33:35: error: expected '{' before ':' token for (pair<int, int> [v, cost] : G[u]) ^ graph.cpp: In function 'void dfs(int)': graph.cpp:33:35: error: expected ';' before ':' token graph.cpp:33:35: error: expected primary-expression before ':' token graph.cpp:33:35: error: expected ')' before ':' token graph.cpp:33:35: error: expected primary-expression before ':' token graph.cpp:33:35: error: expected ';' before ':' token graph.cpp: At global scope: graph.cpp:39:24: error: two or more data types in declaration of 'SortareTopologica' void SortareTopologica() { ^ graph.cpp: In function 'void CalcDistNoduri(int, std::vector<int>&)': graph.cpp:54:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < sortareTopologica.size(); i++) ^ graph.cpp:60:50: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = poz; i < sortareTopologica.size(); i++) { ^ graph.cpp:62:29: error: expected unqualified-id before '[' token for (pair<int, int> [v, cost] : G[u]) ^ graph.cpp:62:29: error: expected ';' before '[' token graph.cpp:62:30: error: 'v' was not declared in this scope for (pair<int, int> [v, cost] : G[u]) ^ graph.cpp:62:33: error: 'cost' was not declared in this scope for (pair<int, int> [v, cost] : G[u]) ^ graph.cpp: In lambda function: graph.cpp:62:39: error: expected '{' before ':' token for (pair<int, int> [v, cost] : G[u]) ^ graph.cpp: In function 'void CalcDistNoduri(int, std::vector<int>&)': graph.cpp:62:39: error: expected ';' before ':' token graph.cpp:62:39: error: expected primary-expression before ':' token graph.cpp:62:39: error: expected ')' before ':' token graph.cpp:62:39: error: expected primary-expression before ':' token graph.cpp:62:39: error: expected ';' before ':' token graph.cpp:61:13: warning: unused variable 'u' [-Wunused-variable] int u = sortareTopologica[i]; ^ graph.cpp: In function 'int main()': graph.cpp:79:23: error: 'SortareTopologica' was not declared in this scope SortareTopologica(); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema graph 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ă.