#1887
Dijkstra are nevoie de ajutorul vostru pentru a-și duce la bun sfârșit datoria. Acesta vrea să afle drumurile de lungime minimă de la casa prietenului său Vlad la celelalte case ale vecinilor. Nu are foarte mult timp la dispoziție așa ca trebuie să vă mișcați repede. Îl veți ajuta?
| Problema | Dijkstra2 | Operații I/O |
dijkstra2.in/dijkstra2.out
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64148887 | Utilizator | |
| Fișier | dijkstra2.cpp | Dimensiune | 1.18 KB |
| Data încărcării | 20 Aprilie 2026, 14:48 | Scor/rezultat | Eroare de compilare |
dijkstra2.cpp: In function ‘int main()’: dijkstra2.cpp:31:21: error: no match for ‘operator=’ (operand types are ‘std::set<std::pair<int, int> >’ and ‘std::set<std::pair<int, int> >::iterator’ {aka ‘std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator’}) 31 | it=se.begin(); | ^ In file included from /usr/include/c++/13/set:63, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:158, from dijkstra2.cpp:1: /usr/include/c++/13/bits/stl_set.h:300:7: note: candidate: ‘std::set<_Key, _Compare, _Alloc>& std::set<_Key, _Compare, _Alloc>::operator=(const std::set<_Key, _Compare, _Alloc>&) [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >]’ 300 | operator=(const set&) = default; | ^~~~~~~~ /usr/include/c++/13/bits/stl_set.h:300:17: note: no known conversion for argument 1 from ‘std::set<std::pair<int, int> >::iterator’ {aka ‘std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator’} to ‘const std::set<std::pair<int, int> >&’ 300 | operator=(const set&) = default; | ^~~~~~~~~~ /usr/include/c++/13/bits/stl_set.h:304:7: note: candidate: ‘std::set<_Key, _Compare, _Alloc>& std::set<_Key, _Compare, _Alloc>::operator=(std::set<_Key, _Compare, _Alloc>&&) [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >]’ 304 | operator=(set&&) = default; | ^~~~~~~~ /usr/include/c++/13/bits/stl_set.h:304:17: note: no known conversion for argument 1 from ‘std::set<std::pair<int, int> >::iterator’ {aka ‘std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator’} to ‘std::set<std::pair<int, int> >&&’ 304 | operator=(set&&) = default; | ^~~~~ /usr/include/c++/13/bits/stl_set.h:318:7: note: candidate: ‘std::set<_Key, _Compare, _Alloc>& std::set<_Key, _Compare, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >]’ 318 | operator=(initializer_list<value_type> __l) | ^~~~~~~~ /usr/include/c++/13/bits/stl_set.h:318:46: note: no known conversion for argument 1 from ‘std::set<std::pair<int, int> >::iterator’ {aka ‘std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator’} to ‘std::initializer_list<std::pair<int, int> >’ 318 | operator=(initializer_list<value_type> __l) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ dijkstra2.cpp:32:17: error: no matching function for call to ‘std::set<std::pair<int, int> >::erase(std::set<std::pair<int, int> >&)’ 32 | se.erase(it); | ~~~~~~~~^~~~ /usr/include/c++/13/bits/stl_set.h:656:7: note: candidate: ‘std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::erase(const_iterator) [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >; iterator = std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator; const_iterator = std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator]’ 656 | erase(const_iterator __position) | ^~~~~ /usr/include/c++/13/bits/stl_set.h:656:28: note: no known conversion for argument 1 from ‘std::set<std::pair<int, int> >’ to ‘std::set<std::pair<int, int> >::const_iterator’ {aka ‘std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator’} 656 | erase(const_iterator __position) | ~~~~~~~~~~~~~~~^~~~~~~~~~ /usr/include/c++/13/bits/stl_set.h:686:7: note: candidate: ‘std::set<_Key, _Compare, _Alloc>::size_type std::set<_Key, _Compare, _Alloc>::erase(const key_type&) [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >; size_type = long unsigned int; key_type = std::pair<int, int>]’ 686 | erase(const key_type& __x) | ^~~~~ /usr/include/c++/13/bits/stl_set.h:686:29: note: no known conversion for argument 1 from ‘std::set<std::pair<int, int> >’ to ‘const std::set<std::pair<int, int> >::key_type&’ {aka ‘const std::pair<int, int>&’} 686 | erase(const key_type& __x) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/13/bits/stl_set.h:708:7: note: candidate: ‘std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::erase(const_iterator, const_iterator) [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >; iterator = std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator; const_iterator = std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator]’ 708 | erase(const_iterator __first, const_iterator __last) | ^~~~~ /usr/include/c++/13/bits/stl_set.h:708:7: note: candidate expects 2 arguments, 1 provided dijkstra2.cpp:33:11: error: no match for ‘operator*’ (operand type is ‘std::set<std::pair<int, int> >’) 33 | a=*it; | ^~~ In file included from /usr/include/c++/13/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:127: /usr/include/c++/13/complex:395:5: note: candidate: ‘template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const complex<_Tp>&)’ 395 | operator*(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/13/complex:395:5: note: template argument deduction/substitution failed: dijkstra2.cpp:33:12: note: ‘std::set<std::pair<int, int> >’ is not derived from ‘const std::complex<_Tp>’ 33 | a=*it; | ^~ /usr/include/c++/13/complex:404:5: note: candidate: ‘template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const _Tp&)’ 404 | operator*(const complex<_Tp>& __x, const _Tp& __y) | ^~~~~~~~ /usr/include/c++/13/complex:404:5: note: template argument deduction/substitution failed: dijkstra2.cpp:33:12: note: ‘std::set<std::pair<int, int> >’ is not derived from ‘const std::complex<_Tp>’ 33 | a=*it; | ^~ /usr/include/c++/13/complex:413:5: note: candidate: ‘template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const complex<_Tp>&)’ 413 | operator*(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/13/complex:413:5: note: template argument deduction/substitution failed: dijkstra2.cpp:33:12: note: candidate expects 2 arguments, 1 provided 33 | a=*it; | ^~ In file included from /usr/include/c++/13/valarray:605, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:166: /usr/include/c++/13/bits/valarray_after.h:407:5: note: candidate: ‘template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)’ 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: dijkstra2.cpp:33:12: note: ‘std::set<std::pair<int, int> >’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ 33 | a=*it; | ^~ /usr/include/c++/13/bits/valarray_after.h:407:5: note: candidate: ‘template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)’ 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: dijkstra2.cpp:33:12: note: ‘std::set<std::pair<int, int> >’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ 33 | a=*it; | ^~ /usr/include/c++/13/bits/valarray_after.h:407:5: note: candidate: ‘template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)’ 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: dijkstra2.cpp:33:12: note: candidate expects 2 arguments, 1 provided 33 | a=*it; | ^~ /usr/include/c++/13/bits/valarray_after.h:407:5: note: candidate: ‘template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)’ 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: dijkstra2.cpp:33:12: note: ‘std::set<std::pair<int, int> >’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ 33 | a=*it; | ^~ /usr/include/c++/13/bits/valarray_after.h:407:5: note: candidate: ‘template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)’ 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: dijkstra2.cpp:33:12: note: candidate expects 2 arguments, 1 provided 33 | a=*it; | ^~ /usr/include/c++/13/valarray:1198:1: note: candidate: ‘template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const valarray<_Tp>&)’ 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/valarray:1198:1: note: template argument deduction/substitution failed: dijkstra2.cpp:33:12: note: ‘std::set<std::pair<int, int> >’ is not derived from ‘const std::valarray<_Tp>’ 33 | a=*it; | ^~ /usr/include/c++/13/valarray:1198:1: note: candidate: ‘template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)’ 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/valarray:1198:1: note: template argument deduction/substitution failed: dijkstra2.cpp:33:12: note: ‘std::set<std::pair<int, int> >’ is not derived from ‘const std::valarray<_Tp>’ 33 | a=*it; | ^~ /usr/include/c++/13/valarray:1198:1: note: candidate: ‘template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)’ 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/valarray:1198:1: note: template argument deduction/substitution failed: dijkstra2.cpp:33:12: note: candidate expects 2 arguments, 1 provided 33 | a=*it; | ^~ dijkstra2.cpp:34:9: error: ‘cost’ was not declared in this scope; did you mean ‘cosl’? 34 | cost=a.first; | ^~~~ | cosl dijkstra2.cpp:35:9: error: ‘nod’ was not declared in this scope 35 | nod=a.second; | ^~~ dijkstra2.cpp:38:45: error: ‘class std::vector<std::pair<int, int> >’ has no member named ‘second’ 38 | if(s[v[nod][x].first]>cost+v[x].second) | ^~~~~~ dijkstra2.cpp:42:37: error: no matching function for call to ‘std::set<std::pair<int, int> >::find(<brace-enclosed initializer list>)’ 42 | se.erase(se.find({s[v[nod][x].first,v[nod][x].first]}) | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_set.h:796:7: note: candidate: ‘std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::find(const key_type&) [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >; iterator = std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator; key_type = std::pair<int, int>]’ 796 | find(const key_type& __x) | ^~~~ /usr/include/c++/13/bits/stl_set.h:796:28: note: no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const std::set<std::pair<int, int> >::key_type&’ {aka ‘const std::pair<int, int>&’} 796 | find(const key_type& __x) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/13/bits/stl_set.h:800:7: note: candidate: ‘std::set<_Key, _Compare, _Alloc>::const_iterator std::set<_Key, _Compare, _Alloc>::find(const key_type&) const [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >; const_iterator = std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator; key_type = std::pair<int, int>]’ 800 | find(const key_type& __x) const | ^~~~ /usr/include/c++/13/bits/stl_set.h:800:28: note: no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const std::set<std::pair<int, int> >::key_type&’ {aka ‘const std::pair<int, int>&’} 800 | find(const key_type& __x) const | ~~~~~~~~~~~~~~~~^~~ dijkstra2.cpp:44:66: error: expected ‘]’ before ‘}’ token 44 | se.insert({s[v[nod][x].first,v[nod][x].first}) | ^ | ] dijkstra2.cpp:44:31: error: no matching function for call to ‘std::set<std::pair<int, int> >::insert(<brace-enclosed initializer list>)’ 44 | se.insert({s[v[nod][x].first,v[nod][x].first}) | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_set.h:568:9: note: candidate: ‘template<class _InputIterator> void std::set<_Key, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >]’ 568 | insert(_InputIterator __first, _InputIterator __last) | ^~~~~~ /usr/include/c++/13/bits/stl_set.h:568:9: note: template argument deduction/substitution failed: dijkstra2.cpp:44:31: note: candidate expects 2 arguments, 1 provided 44 | se.insert({s[v[nod][x].first,v[nod][x].first}) | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_set.h:511:7: note: candidate: ‘std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const value_type&) [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other = std::allocator<std::pair<int, int> >; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::rebind<std::pair<int, int> >; typename _Alloc::value_type = std::pair<int, int>; value_type = std::pair<int, int>]’ 511 | insert(const value_type& __x) | ^~~~~~ /usr/include/c++/13/bits/stl_set.h:511:32: note: no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const std::set<std::pair<int, int> >::value_type&’ {aka ‘const std::pair<int, int>&’} 511 | insert(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/13/bits/stl_set.h:520:7: note: candidate: ‘std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(value_type&&) [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other = std::allocator<std::pair<int, int> >; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::rebind<std::pair<int, int> >; typename _Alloc::value_type = std::pair<int, int>; value_type = std::pair<int, int>]’ 520 | insert(value_type&& __x) | ^~~~~~ /usr/include/c++/13/bits/stl_set.h:520:27: note: no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::set<std::pair<int, int> >::value_type&&’ {aka ‘std::pair<int, int>&&’} 520 | insert(value_type&& __x) | ~~~~~~~~~~~~~^~~ /usr/include/c++/13/bits/stl_set.h:548:7: note: candidate: ‘std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(const_iterator, const value_type&) [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >; iterator = std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator; const_iterator = std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator; value_type = std::pair<int, int>]’ 548 | insert(const_iterator __position, const value_type& __x) | ^~~~~~ /usr/include/c++/13/bits/stl_set.h:548:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/13/bits/stl_set.h:553:7: note: candidate: ‘std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(const_iterator, value_type&&) [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >; iterator = std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator; const_iterator = std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator; value_type = std::pair<int, int>]’ 553 | insert(const_iterator __position, value_type&& __x) | ^~~~~~ /usr/include/c++/13/bits/stl_set.h:553:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/13/bits/stl_set.h:580:7: note: candidate: ‘void std::set<_Key, _Compare, _Alloc>::insert(std::initializer_list<_Tp>) [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >]’ 580 | insert(initializer_list<value_type> __l) | ^~~~~~ /usr/include/c++/13/bits/stl_set.h:580:43: note: no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::initializer_list<std::pair<int, int> >’ 580 | insert(initializer_list<value_type> __l) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ dijkstra2.cpp:49:9: error: ‘i’ was not declared in this scope 49 | for(i=1;i<=n;i++) | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Dijkstra2 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ă.