#1861
TopSort
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 | #50488061 | Utilizator | |
Fișier | topsort.cpp | Dimensiune | 718 B |
Data încărcării | 11 Aprilie 2024, 12:05 | Scor / rezultat | Eroare de compilare |
topsort.cpp:3:1: error: 'ifstream' does not name a type ifstream in("topsort.in"); ^ topsort.cpp:4:1: error: 'ofstream' does not name a type ofstream out("topsort.out"); ^ topsort.cpp:6:7: error: expected nested-name-specifier before 'namespaced' using namespaced std ; ^ topsort.cpp:6:7: error: 'namespaced' has not been declared topsort.cpp:6:18: error: expected ';' before 'std' using namespaced std ; ^ topsort.cpp:6:18: error: 'std' does not name a type topsort.cpp:9:19: error: size of array 'G' is too large int G[MAX_N][MAX_N]; ^ topsort.cpp: In function 'void dfs(int)': topsort.cpp:19:13: error: 'G' was not declared in this scope if (G[nod][i] && !v[i]) { ^ topsort.cpp: In function 'int main()': topsort.cpp:28:5: error: 'in' was not declared in this scope in >> n >> m; ^ topsort.cpp:31:9: error: 'G' was not declared in this scope G[x][y] = 1; ^ topsort.cpp:39:9: error: 'out' was not declared in this scope out << L[i] << " "; ^
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ă.