#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 | #48007972 | Utilizator | |
Fișier | dijkstra2.cpp | Dimensiune | 1.21 KB |
Data încărcării | 12 Ianuarie 2024, 16:51 | Scor / rezultat | Eroare de compilare |
dijkstra2.cpp: In function 'void dijkstra(int, int*)': dijkstra2.cpp:21:14: error: expected unqualified-id before '[' token auto [cost, node] = pq.top(); ^ dijkstra2.cpp:23:14: error: 'node' was not declared in this scope if(D[node] <= cost) { ^ dijkstra2.cpp:23:23: error: 'cost' was not declared in this scope if(D[node] <= cost) { ^ dijkstra2.cpp:26:11: error: 'node' was not declared in this scope D[node] = cost; ^ dijkstra2.cpp:26:19: error: 'cost' was not declared in this scope D[node] = cost; ^ dijkstra2.cpp:27:18: error: expected unqualified-id before '[' token for(auto [c, x] : G[node]) { ^ dijkstra2.cpp:27:18: error: expected ';' before '[' token dijkstra2.cpp:27:19: error: 'c' was not declared in this scope for(auto [c, x] : G[node]) { ^ dijkstra2.cpp:27:22: error: 'x' was not declared in this scope for(auto [c, x] : G[node]) { ^ dijkstra2.cpp: In lambda function: dijkstra2.cpp:27:25: error: expected '{' before ':' token for(auto [c, x] : G[node]) { ^ dijkstra2.cpp: In function 'void dijkstra(int, int*)': dijkstra2.cpp:27:25: error: expected ';' before ':' token dijkstra2.cpp:27:25: error: expected primary-expression before ':' token dijkstra2.cpp:27:25: error: expected ')' before ':' token dijkstra2.cpp:27:25: error: expected primary-expression before ':' token dijkstra2.cpp:27:25: error: expected ';' before ':' token dijkstra2.cpp: In function 'int main()': dijkstra2.cpp:36:40: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("dijkstra2.in", "r", stdin); ^ dijkstra2.cpp:37:42: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("dijkstra2.out", "w", stdout); ^
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ă.