#2768
SortTopMinLex
Se consideră un graf orientat aciclic cu n
noduri și m
arce. Să se determine sortarea topologică a nodurilor grafului, minimă lexicografic.
Folclorul informatic
Problema | SortTopMinLex | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 32 MB
|
Id soluție | #42306432 | Utilizator | |
Fișier | sorttopminlex.cpp | Dimensiune | 646 B |
Data încărcării | 28 Februarie 2023, 10:39 | Scor / rezultat | Eroare de compilare |
sorttopminlex.cpp:1:20: warning: extra tokens at end of #include directive [enabled by default] #include <iostream>#include <queue>#include <vector>#define M 100010 ^ sorttopminlex.cpp:3:12: error: 'M' was not declared in this scope int n,m,fr[M],x,y; ^ sorttopminlex.cpp:4:1: error: 'priority_queue' does not name a type priority_queue<int>q; ^ sorttopminlex.cpp:5:1: error: 'vector' does not name a type vector<int>a[M]; ^ sorttopminlex.cpp: In function 'void bfs()': sorttopminlex.cpp:8:12: error: 'q' was not declared in this scope while(!q.empty()) ^ sorttopminlex.cpp:13:20: error: 'a' was not declared in this scope for(auto e:a[-aux]) ^ sorttopminlex.cpp:15:13: error: 'fr' was not declared in this scope fr[e]--; ^ sorttopminlex.cpp: In function 'int main()': sorttopminlex.cpp:27:9: error: 'fr' was not declared in this scope fr[y]++; ^ sorttopminlex.cpp:28:9: error: 'a' was not declared in this scope a[x].push_back(y); ^ sorttopminlex.cpp:31:12: error: 'fr' was not declared in this scope if(fr[i]==0) ^ sorttopminlex.cpp:32:12: error: 'q' was not declared in this scope q.push(-i); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SortTopMinLex 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ă.