#538
LungimeMinima
Se dă lista muchiilor unui graf neorientat cu n
vârfuri și vârf p
. Să se determine toate nodurile q
ale grafului cu proprietatea că lungimea minimă a unui lanț de la q
la p
este L
.
Problema | LungimeMinima | Operații I/O |
lungimeminima.in /lungimeminima.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #48598991 | Utilizator | |
Fișier | lungimeminima.cpp | Dimensiune | 857 B |
Data încărcării | 30 Ianuarie 2024, 18:28 | Scor / rezultat | Eroare de compilare |
lungimeminima.cpp:3:13: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin("lungimeminima.in"); ^ lungimeminima.cpp:4:14: error: variable 'std::ofstream cout' has initializer but incomplete type ofstream cout("lungimeminima.out"); ^ lungimeminima.cpp: In function 'void bfs(int)': lungimeminima.cpp:10:5: error: 'queue' was not declared in this scope queue <int> Q; ^ lungimeminima.cpp:10:12: error: expected primary-expression before 'int' queue <int> Q; ^ lungimeminima.cpp:10:12: error: expected ';' before 'int' lungimeminima.cpp:11:5: error: 'Q' was not declared in this scope Q.push(x); ^ lungimeminima.cpp: In function 'int main()': lungimeminima.cpp:27:5: error: reference to 'cin' is ambiguous cin >> n >> p >> L; ^ lungimeminima.cpp:3:10: note: candidates are: <typeprefixerror>cin ifstream cin("lungimeminima.in"); ^ In file included from lungimeminima.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ lungimeminima.cpp:28:11: error: reference to 'cin' is ambiguous while(cin >> x >> y) ^ lungimeminima.cpp:3:10: note: candidates are: <typeprefixerror>cin ifstream cin("lungimeminima.in"); ^ In file included from lungimeminima.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ lungimeminima.cpp:35:5: error: reference to 'cout' is ambiguous cout << cnt << '\n'; ^ lungimeminima.cpp:4:10: note: candidates are: <typeprefixerror>cout ofstream cout("lungimeminima.out"); ^ In file included from lungimeminima.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ lungimeminima.cpp:37:27: error: reference to 'cout' is ambiguous if(d[i] == L + 1) cout << i << " "; ^ lungimeminima.cpp:4:10: note: candidates are: <typeprefixerror>cout ofstream cout("lungimeminima.out"); ^ In file included from lungimeminima.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema LungimeMinima 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ă.