#1861
Se dă un graf orientat aciclic cu N noduri numerotate de la 1 la N. Să se realizeze o sortare topologică a nodurilor.
| Problema | TopSort | Operații I/O |
topsort.in/topsort.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63425006 | Utilizator | |
| Fișier | topsort.cpp | Dimensiune | 1.54 KB |
| Data încărcării | 03 Martie 2026, 09:29 | Scor/rezultat | Eroare de compilare |
topsort.cpp:5:14: error: variable 'std::ifstream fin' has initializer but incomplete type ifstream fin ("fluviu.in"); ^ topsort.cpp:6:15: error: variable 'std::ofstream fout' has initializer but incomplete type ofstream fout ("fluviu.out"); ^ topsort.cpp:17:1: error: 'vector' does not name a type vector <graf> g[NMAX]; ^ topsort.cpp: In function 'void parcurge()': topsort.cpp:37:13: error: 'i' was not declared in this scope for(i = 0; i < g[x].size(); i++) ^ topsort.cpp:37:24: error: 'g' was not declared in this scope for(i = 0; i < g[x].size(); i++) ^ topsort.cpp:42:13: error: expected primary-expression before '}' token } ^ topsort.cpp:42:13: error: expected ';' before '}' token topsort.cpp:32:10: warning: unused variable 'loc' [-Wunused-variable] char loc = 'p'; ^ topsort.cpp: In function 'void citire()': topsort.cpp:68:9: error: 'g' was not declared in this scope g[i].push_back(aux); ^ topsort.cpp:76:9: error: 'g' was not declared in this scope g[i].push_back(aux); ^ topsort.cpp:84:9: error: 'g' was not declared in this scope g[i].push_back(aux); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema TopSort 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ă.