#438
ComponenteConexe
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 | #55017947 | Utilizator | |
Fișier | componenteconexe.cpp | Dimensiune | 1.27 KB |
Data încărcării | 16 Decembrie 2024, 19:27 | Scor / rezultat | Eroare de compilare |
componenteconexe.cpp: In function 'void bfs(int, int)': componenteconexe.cpp:22:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(j=0;j<G[u].size();++j){ ^ componenteconexe.cpp: In function 'int main()': componenteconexe.cpp:46:31: error: no matching function for call to 'find(std::vector<int>::iterator, int&)' if(find(G[u].begin(),v)==G[u].end()){ ^ componenteconexe.cpp:46:31: note: candidates are: In file included from /usr/include/c++/4.8/bits/locale_facets.h:48:0, from /usr/include/c++/4.8/bits/basic_ios.h:37, from /usr/include/c++/4.8/ios:44, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from componenteconexe.cpp:1: /usr/include/c++/4.8/bits/streambuf_iterator.h:369:5: note: template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&) find(istreambuf_iterator<_CharT> __first, ^ /usr/include/c++/4.8/bits/streambuf_iterator.h:369:5: note: template argument deduction/substitution failed: componenteconexe.cpp:46:31: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' if(find(G[u].begin(),v)==G[u].end()){ ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from componenteconexe.cpp:2: /usr/include/c++/4.8/bits/stl_algo.h:4432:5: note: template<class _IIter, class _Tp> _IIter std::find(_IIter, _IIter, const _Tp&) find(_InputIterator __first, _InputIterator __last, ^ /usr/include/c++/4.8/bits/stl_algo.h:4432:5: note: template argument deduction/substitution failed: componenteconexe.cpp:46:31: note: deduced conflicting types for parameter '_IIter' ('__gnu_cxx::__normal_iterator<int*, std::vector<int> >' and 'int') if(find(G[u].begin(),v)==G[u].end()){ ^ componenteconexe.cpp:43:19: warning: unused variable 'i' [-Wunused-variable] int n,m,start,i,u,v; ^
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ă.