#4304
ff
Se dă un graf neorientat. Să se determine un subgraf al său, cu număr cât mai mare de noduri și în care fiecare nod are gradul cel puțin 2
.
CPPI Craiova - Concurs de antrenament 4-5 ianuarie 2023
Problema | ff | Operații I/O |
![]() ff.in /ff.out
|
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51278303 | Utilizator | |
Fișier | ff.cpp | Dimensiune | 981 B |
Data încărcării | 03 Iunie 2024, 20:17 | Scor / rezultat | Eroare de compilare |
ff.cpp: In function 'void bfs_elim()': ff.cpp:25:30: error: no matching function for call to 'std::vector<int>::erase(int&)' G[first].erase(x); ^ ff.cpp:25:30: note: candidates are: In file included from /usr/include/c++/4.8/vector:69:0, from ff.cpp:2: /usr/include/c++/4.8/bits/vector.tcc:134:5: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::iterator) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*] vector<_Tp, _Alloc>:: ^ /usr/include/c++/4.8/bits/vector.tcc:134:5: note: no known conversion for argument 1 from 'int' to 'std::vector<int>::iterator {aka __gnu_cxx::__normal_iterator<int*, std::vector<int> >}' /usr/include/c++/4.8/bits/vector.tcc:146:5: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::iterator, std::vector<_Tp, _Alloc>::iterator) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*] vector<_Tp, _Alloc>:: ^ /usr/include/c++/4.8/bits/vector.tcc:146:5: note: candidate expects 2 arguments, 1 provided ff.cpp:26:33: error: no matching function for call to 'std::vector<int>::erase(int&)' G[x].erase(first); ^ ff.cpp:26:33: note: candidates are: In file included from /usr/include/c++/4.8/vector:69:0, from ff.cpp:2: /usr/include/c++/4.8/bits/vector.tcc:134:5: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::iterator) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*] vector<_Tp, _Alloc>:: ^ /usr/include/c++/4.8/bits/vector.tcc:134:5: note: no known conversion for argument 1 from 'int' to 'std::vector<int>::iterator {aka __gnu_cxx::__normal_iterator<int*, std::vector<int> >}' /usr/include/c++/4.8/bits/vector.tcc:146:5: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::iterator, std::vector<_Tp, _Alloc>::iterator) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*] vector<_Tp, _Alloc>:: ^ /usr/include/c++/4.8/bits/vector.tcc:146:5: note: candidate expects 2 arguments, 1 provided ff.cpp: In function 'int main()': ff.cpp:42:16: error: no matching function for call to 'std::vector<int>::insert(int&)' G[a].insert(b); ^ ff.cpp:42:16: note: candidates are: In file included from /usr/include/c++/4.8/vector:69:0, from ff.cpp:2: /usr/include/c++/4.8/bits/vector.tcc:107:5: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::iterator, const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*; std::vector<_Tp, _Alloc>::value_type = int] vector<_Tp, _Alloc>:: ^ /usr/include/c++/4.8/bits/vector.tcc:107:5: note: candidate expects 2 arguments, 1 provided In file included from /usr/include/c++/4.8/vector:64:0, from ff.cpp:2: /usr/include/c++/4.8/bits/stl_vector.h:988:7: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::iterator, std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*; std::vector<_Tp, _Alloc>::value_type = int] insert(iterator __position, value_type&& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:988:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/4.8/bits/stl_vector.h:1005:7: note: void std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::iterator, std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*] insert(iterator __position, initializer_list<value_type> __l) ^ /usr/include/c++/4.8/bits/stl_vector.h:1005:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/4.8/bits/stl_vector.h:1023:7: note: void std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::iterator, std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*; std::vector<_Tp, _Alloc>::size_type = unsigned int; std::vector<_Tp, _Alloc>::value_type = int] insert(iterator __position, size_type __n, const value_type& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:1023:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/4.8/bits/stl_vector.h:1044:9: note: template<class _InputIterator, class> void std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::iterator, _InputIterator, _InputIterator) [with _InputIterator = _InputIterator; <template-parameter-2-2> = <template-parameter-1-2>; _Tp = int; _Alloc = std::allocator<int>] insert(iterator __position, _InputIterator __first, ^ /usr/include/c++/4.8/bits/stl_vector.h:1044:9: note: template argument deduction/substitution failed: ff.cpp:42:16: note: cannot convert 'b' (type 'int') to type 'std::vector<int>::iterator {aka __gnu_cxx::__normal_iterator<int*, std::vector<int> >}' G[a].insert(b); ^ ff.cpp:43:22: error: no matching function for call to 'std::vector<int>::insert(int&)' G[b].insert(a); ^ ff.cpp:43:22: note: candidates are: In file included from /usr/include/c++/4.8/vector:69:0, from ff.cpp:2: /usr/include/c++/4.8/bits/vector.tcc:107:5: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::iterator, const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*; std::vector<_Tp, _Alloc>::value_type = int] vector<_Tp, _Alloc>:: ^ /usr/include/c++/4.8/bits/vector.tcc:107:5: note: candidate expects 2 arguments, 1 provided In file included from /usr/include/c++/4.8/vector:64:0, from ff.cpp:2: /usr/include/c++/4.8/bits/stl_vector.h:988:7: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::iterator, std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*; std::vector<_Tp, _Alloc>::value_type = int] insert(iterator __position, value_type&& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:988:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/4.8/bits/stl_vector.h:1005:7: note: void std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::iterator, std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*] insert(iterator __position, initializer_list<value_type> __l) ^ /usr/include/c++/4.8/bits/stl_vector.h:1005:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/4.8/bits/stl_vector.h:1023:7: note: void std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::iterator, std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*; std::vector<_Tp, _Alloc>::size_type = unsigned int; std::vector<_Tp, _Alloc>::value_type = int] insert(iterator __position, size_type __n, const value_type& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:1023:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/4.8/bits/stl_vector.h:1044:9: note: template<class _InputIterator, class> void std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::iterator, _InputIterator, _InputIterator) [with _InputIterator = _InputIterator; <template-parameter-2-2> = <template-parameter-1-2>; _Tp = int; _Alloc = std::allocator<int>] insert(iterator __position, _InputIterator __first, ^ /usr/include/c++/4.8/bits/stl_vector.h:1044:9: note: template argument deduction/substitution failed: ff.cpp:43:22: note: cannot convert 'a' (type 'int') to type 'std::vector<int>::iterator {aka __gnu_cxx::__normal_iterator<int*, std::vector<int> >}' G[b].insert(a); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ff 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ă.