#1887
Dijkstra2
Dijkstra are nevoie de ajutorul vostru pentru a-și duce la bun sfârșit datoria. Acesta vrea să afle drumurile de lungime minimă de la casa prietenului său Vlad la celelalte case ale vecinilor. Nu are foarte mult timp la dispoziție așa ca trebuie să vă mișcați repede. Îl veți ajuta?
Problema | Dijkstra2 | Operații I/O |
dijkstra2.in /dijkstra2.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #34465636 | Utilizator | |
Fișier | dijkstra2.cpp | Dimensiune | 1.32 KB |
Data încărcării | 02 Februarie 2022, 23:23 | Scor / rezultat | Eroare de compilare |
dijkstra2.cpp: In function 'void dijkstra(const int&)': dijkstra2.cpp:17:14: error: expected unqualified-id before '[' token auto [cost, node] = pq.top(); ^ dijkstra2.cpp:19:13: error: 'cost' was not declared in this scope if (cost > dist[node]) { ^ dijkstra2.cpp:19:25: error: 'node' was not declared in this scope if (cost > dist[node]) { ^ dijkstra2.cpp:22:26: error: expected unqualified-id before '[' token for (const auto& [newNode, newCost] : adjList[node]) { ^ dijkstra2.cpp:22:26: error: expected ';' before '[' token dijkstra2.cpp:22:27: error: 'newNode' was not declared in this scope for (const auto& [newNode, newCost] : adjList[node]) { ^ dijkstra2.cpp:22:36: error: 'newCost' was not declared in this scope for (const auto& [newNode, newCost] : adjList[node]) { ^ dijkstra2.cpp: In lambda function: dijkstra2.cpp:22:45: error: expected '{' before ':' token for (const auto& [newNode, newCost] : adjList[node]) { ^ dijkstra2.cpp: In function 'void dijkstra(const int&)': dijkstra2.cpp:22:45: error: expected ';' before ':' token dijkstra2.cpp:22:45: error: expected primary-expression before ':' token dijkstra2.cpp:22:45: error: expected ')' before ':' token dijkstra2.cpp:22:45: error: expected primary-expression before ':' token dijkstra2.cpp:22:45: error: expected ';' before ':' token dijkstra2.cpp:51:1: error: expected '}' at end of input } ^ dijkstra2.cpp:51:1: error: expected '}' at end of input
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Dijkstra2 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ă.