#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 | #49531525 | Utilizator | |
Fișier | componenteconexe.cpp | Dimensiune | 1.04 KB |
Data încărcării | 06 Martie 2024, 09:07 | Scor / rezultat | Eroare de compilare |
In file included from /usr/include/c++/4.8/algorithm:62:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from componenteconexe.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]': /usr/include/c++/4.8/bits/stl_algo.h:2211:62: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' /usr/include/c++/4.8/bits/stl_algo.h:5462:47: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' componenteconexe.cpp:43:38: required from here /usr/include/c++/4.8/bits/stl_algo.h:2142:17: error: assignment of read-only location '__first.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator*<const int*, std::vector<int> >()' *__first = _GLIBCXX_MOVE(__val); ^ In file included from /usr/include/c++/4.8/bits/stl_algo.h:61:0, from /usr/include/c++/4.8/algorithm:62, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from componenteconexe.cpp:1: /usr/include/c++/4.8/bits/stl_heap.h: In instantiation of 'void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]': /usr/include/c++/4.8/bits/stl_algo.h:1936:42: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' /usr/include/c++/4.8/bits/stl_algo.h:5308:51: required from 'void std::partial_sort(_RAIter, _RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' /usr/include/c++/4.8/bits/stl_algo.h:2310:60: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; _Size = int]' /usr/include/c++/4.8/bits/stl_algo.h:5461:36: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' componenteconexe.cpp:43:38: required from here /usr/include/c++/4.8/bits/stl_heap.h:262:17: error: assignment of read-only location '__result.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator*<const int*, std::vector<int> >()' *__result = _GLIBCXX_MOVE(*__first); ^ /usr/include/c++/4.8/bits/stl_heap.h: In instantiation of 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; _Distance = int; _Tp = int]': /usr/include/c++/4.8/bits/stl_heap.h:407:71: required from 'void std::make_heap(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' /usr/include/c++/4.8/bits/stl_algo.h:1933:39: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' /usr/include/c++/4.8/bits/stl_algo.h:5308:51: required from 'void std::partial_sort(_RAIter, _RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' /usr/include/c++/4.8/bits/stl_algo.h:2310:60: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; _Size = int]' /usr/include/c++/4.8/bits/stl_algo.h:5461:36: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' componenteconexe.cpp:43:38: required from here /usr/include/c++/4.8/bits/stl_heap.h:237:29: error: assignment of read-only location '__first.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator+<const int*, std::vector<int> >((*(const difference_type*)(& __holeIndex))).__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator*<const int*, std::vector<int> >()' *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first + __secondChild)); ^ /usr/include/c++/4.8/bits/stl_heap.h:243:29: error: assignment of read-only location '__first.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator+<const int*, std::vector<int> >((*(const difference_type*)(& __holeIndex))).__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator*<const int*, std::vector<int> >()' *(__first + __holeIndex) = _GLIBCXX_MOVE(*(__first ^ In file included from /usr/include/c++/4.8/bits/stl_pair.h:59:0, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from componenteconexe.cpp:1: /usr/include/c++/4.8/bits/move.h: In instantiation of 'void std::swap(_Tp&, _Tp&) [with _Tp = const int]': /usr/include/c++/4.8/bits/stl_algobase.h:147:22: required from 'void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; _ForwardIterator2 = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' /usr/include/c++/4.8/bits/stl_algo.h:88:34: required from 'void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator) [with _Iterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' /usr/include/c++/4.8/bits/stl_algo.h:2282:74: required from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' /usr/include/c++/4.8/bits/stl_algo.h:2315:54: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; _Size = int]' /usr/include/c++/4.8/bits/stl_algo.h:5461:36: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' componenteconexe.cpp:43:38: required from here /usr/include/c++/4.8/bits/move.h:176:11: error: assignment of read-only reference '__a' __a = _GLIBCXX_MOVE(__b); ^ /usr/include/c++/4.8/bits/move.h:177:11: error: assignment of read-only reference '__b' __b = _GLIBCXX_MOVE(__tmp); ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from componenteconexe.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h: In instantiation of '_BI2 std::__copy_move_backward_a(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = const int*; _BI2 = const int*]': /usr/include/c++/4.8/bits/stl_algobase.h:596:33: required from '_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = true; _BI1 = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; _BI2 = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' /usr/include/c++/4.8/bits/stl_algobase.h:667:15: required from '_BI2 std::move_backward(_BI1, _BI1, _BI2) [with _BI1 = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; _BI2 = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' /usr/include/c++/4.8/bits/stl_algo.h:2141:8: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' /usr/include/c++/4.8/bits/stl_algo.h:2211:62: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' /usr/include/c++/4.8/bits/stl_algo.h:5462:47: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]' componenteconexe.cpp:43:38: required from here /usr/include/c++/4.8/bits/stl_algobase.h:587:18: error: no matching function for call to 'std::__copy_move_backward<true, true, std::random_access_iterator_tag>::__copy_move_b(const int*&, const int*&, const int*&)' __result); ^ /usr/include/c++/4.8/bits/stl_algobase.h:587:18: note: candidate is: /usr/include/c++/4.8/bits/stl_algobase.h:563:9: note: template<class _Tp> static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*) [with _Tp = _Tp; bool _IsMove = true] __copy_move_b(const _Tp* __first, const _Tp* __last, _Tp* __result) ^ /usr/include/c++/4.8/bits/stl_algobase.h:563:9: note: template argument deduction/substitution failed: /usr/include/c++/4.8/bits/stl_algobase.h:587:18: note: deduced conflicting types for parameter '_Tp' ('int' and 'const int') __result); ^
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ă.