#441
ComponenteConexe1
Se dă lista muchiilor unui graf neorientat. Să se determine numărul minim de muchii care trebuie adăugate pentru ca graful să devină conex, precum și un set de asemenea muchii.
Problema | ComponenteConexe1 | Operații I/O |
componenteconexe1.in /componenteconexe1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54836599 | Utilizator | |
Fișier | componenteconexe1.cpp | Dimensiune | 762 B |
Data încărcării | 10 Decembrie 2024, 00:17 | Scor / rezultat | Eroare de compilare |
componenteconexe1.cpp:4:13: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin("componenteconexe1.in"); ^ componenteconexe1.cpp:5:14: error: variable 'std::ofstream cout' has initializer but incomplete type ofstream cout("componenteconexe1.in.out"); ^ componenteconexe1.cpp: In function 'int main()': componenteconexe1.cpp:18:5: error: reference to 'cin' is ambiguous cin >> n; ^ componenteconexe1.cpp:4:10: note: candidates are: <typeprefixerror>cin ifstream cin("componenteconexe1.in"); ^ In file included from componenteconexe1.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ componenteconexe1.cpp:19:11: error: reference to 'cin' is ambiguous while(cin >> x >> y) { ^ componenteconexe1.cpp:4:10: note: candidates are: <typeprefixerror>cin ifstream cin("componenteconexe1.in"); ^ In file included from componenteconexe1.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ componenteconexe1.cpp:26:5: error: reference to 'cout' is ambiguous cout << c-1 << endl; ^ componenteconexe1.cpp:5:10: note: candidates are: <typeprefixerror>cout ofstream cout("componenteconexe1.in.out"); ^ In file included from componenteconexe1.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ componenteconexe1.cpp:32:9: error: reference to 'cout' is ambiguous cout << 1 << ' ' << o; ^ componenteconexe1.cpp:5:10: note: candidates are: <typeprefixerror>cout ofstream cout("componenteconexe1.in.out"); ^ In file included from componenteconexe1.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ componenteconexe1.cpp:33:9: error: reference to 'cout' is ambiguous cout << endl; ^ componenteconexe1.cpp:5:10: note: candidates are: <typeprefixerror>cout ofstream cout("componenteconexe1.in.out"); ^ In file included from componenteconexe1.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 ComponenteConexe1 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ă.