#4962
Se dă lista muchiilor unui graf neorientat. Să se determine muchiile care pot fi adăugate în graf astfel încât numărul de componente conexe ale grafului să nu se modifice.
| Problema | ComponenteConexe12 | Operații I/O |
componenteconexe12.in/componenteconexe12.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64987464 | Utilizator | |
| Fișier | componenteconexe12.cpp | Dimensiune | 1.68 KB |
| Data încărcării | 05 Iulie 2026, 14:50 | Scor/rezultat | Eroare de compilare |
componenteconexe12.cpp: In function ‘int main()’: componenteconexe12.cpp:60:26: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 60 | for(int i = 0; i < component.size(); i ++){ | ~~^~~~~~~~~~~~~~~~~~ componenteconexe12.cpp:61:34: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 61 | for(int j = i + 1; j < component.size(); j ++){ | ~~^~~~~~~~~~~~~~~~~~ componenteconexe12.cpp:64:21: error: ‘egdes’ was not declared in this scope; did you mean ‘edges’? 64 | egdes.push_back({component[i], component[j]}); | ^~~~~ | edges componenteconexe12.cpp:72:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::pair<int, int> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 72 | for(int i = 0; i < edges.size(); i ++){ | ~~^~~~~~~~~~~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ComponenteConexe12 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ă.