#4027
LongestPath
Se dă un graf orientat aciclic (adică nu există circuite). Lungimea unui drum elementar este dată de numărul de arce. Să se determine lungimea maximă a unui drum elementar în acest graf orientat aciclic.
Folclorul informatic
Problema | LongestPath | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.4 secunde | Limita memorie |
Total: 128 MB
/
Stivă 64 MB
|
Id soluție | #42350070 | Utilizator | |
Fișier | longestpath.cpp | Dimensiune | 681 B |
Data încărcării | 02 Martie 2023, 10:05 | Scor / rezultat | Eroare de compilare |
longestpath.cpp:3:10: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix] #include <vector>using namespace std; ^ longestpath.cpp:3:18: warning: extra tokens at end of #include directive [enabled by default] #include <vector>using namespace std; ^ longestpath.cpp:5:1: error: 'queue' does not name a type queue<int>q; ^ longestpath.cpp:6:1: error: 'vector' does not name a type vector<int>v[100005]; ^ longestpath.cpp: In function 'int main()': longestpath.cpp:9:5: error: 'cin' was not declared in this scope cin>>n>>m; ^ longestpath.cpp:9:5: note: suggested alternative: In file included from longestpath.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ longestpath.cpp:14:9: error: 'v' was not declared in this scope v[x].push_back(y); ^ longestpath.cpp:18:22: error: 'q' was not declared in this scope if(gi[i]==0) q.push(i); ^ longestpath.cpp:19:12: error: 'q' was not declared in this scope while(!q.empty()) ^ longestpath.cpp:23:20: error: 'v' was not declared in this scope for(auto i:v[aux]) ^ longestpath.cpp:32:5: error: 'cout' was not declared in this scope cout<<maxd; ^ longestpath.cpp:32:5: note: suggested alternative: In file included from longestpath.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema LongestPath 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ă.