#438
Se dă lista muchiilor unui graf neorientat. Să se afișeze componentele conexe ale acestui graf.
| Problema | ComponenteConexe | Operații I/O |
componenteconexe.in/componenteconexe.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #61788378 | Utilizator | |
| Fișier | componenteconexe.cpp | Dimensiune | 807 B |
| Data încărcării | 10 Decembrie 2025, 10:18 | Scor/rezultat | Eroare de compilare |
componenteconexe.cpp: In function 'void BFS(int)': componenteconexe.cpp:11:14: error: 'nr' was not declared in this scope v[start]=nr; ^ componenteconexe.cpp: In function 'int main()': componenteconexe.cpp:28:14: error: cannot bind 'std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}' lvalue to 'std::basic_istream<char>&&' while(fin>>x>>y) ^ In file included from /usr/include/c++/4.8/iostream:40:0, from componenteconexe.cpp:1: /usr/include/c++/4.8/istream:872:5: error: initializing argument 1 of 'std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = int [101]]' operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x) ^ componenteconexe.cpp:30:15: error: invalid types 'int [201][int [101]]' for array subscript a[x][y]=1; ^ componenteconexe.cpp:31:12: error: invalid types 'int [201][201][int [101]]' for array subscript a[y][x]=1; ^ componenteconexe.cpp:36:9: error: 'nr' was not declared in this scope nr++; ^ componenteconexe.cpp:39:11: error: 'nr' was not declared in this scope fout<<nr<<'\n'; ^ componenteconexe.cpp:42:14: error: 'j' was not declared in this scope if(v[j]==i) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ComponenteConexe 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ă.