Grafo spalvinimas
- [1] 2024-12-21 13:51 (0)
- [2] 2024-12-21 13:53 (44)
- [3] 2024-12-21 14:11 (96)
- [4] 2024-12-21 14:13 (100)
Taškai: 0
Compile: FAIL
grafo_spalvinimas.cpp: In function ‘int main()’: grafo_spalvinimas.cpp:54:51: error: use of ‘auto’ in lambda parameter declaration only available with ‘-std=c++14’ or ‘-std=gnu++14’ 54 | sort(nodeOrder.begin()+1, nodeOrder.end(), [](auto &a, auto &b){ | ^~~~ grafo_spalvinimas.cpp:54:60: error: use of ‘auto’ in lambda parameter declaration only available with ‘-std=c++14’ or ‘-std=gnu++14’ 54 | sort(nodeOrder.begin()+1, nodeOrder.end(), [](auto &a, auto &b){ | ^~~~ grafo_spalvinimas.cpp: In lambda function: grafo_spalvinimas.cpp:55:15: error: request for member ‘second’ in ‘a’, which is of non-class type ‘int’ 55 | if(a.second > b.second) return true; | ^~~~~~ grafo_spalvinimas.cpp:55:26: error: request for member ‘second’ in ‘b’, which is of non-class type ‘int’ 55 | if(a.second > b.second) return true; | ^~~~~~ grafo_spalvinimas.cpp:56:25: error: request for member ‘first’ in ‘a’, which is of non-class type ‘int’ 56 | else return (a.first < b.second); | ^~~~~ grafo_spalvinimas.cpp:56:35: error: request for member ‘second’ in ‘b’, which is of non-class type ‘int’ 56 | else return (a.first < b.second); | ^~~~~~ In file included from /usr/include/c++/11/bits/stl_algobase.h:71, from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/sstream:38, from /usr/include/c++/11/complex:45, from /usr/include/c++/11/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54, from grafo_spalvinimas.cpp:1: /usr/include/c++/11/bits/predefined_ops.h: In instantiation of ‘bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Iterator2 = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Compare = main()::<lambda(int&, int&)>]’: /usr/include/c++/11/bits/stl_algo.h:1826:14: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda(int&, int&)> >]’ /usr/include/c++/11/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda(int&, int&)> >]’ /usr/include/c++/11/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda(int&, int&)> >]’ /usr/include/c++/11/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Compare = main()::<lambda(int&, int&)>]’ grafo_spalvinimas.cpp:54:9: required from here /usr/include/c++/11/bits/predefined_ops.h:158:30: error: no match for call to ‘(main()::<lambda(int&, int&)>) (std::pair<int, int>&, std::pair<int, int>&)’ 158 | { return bool(_M_comp(*__it1, *__it2)); } | ~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/11/bits/predefined_ops.h:158:30: note: candidate: ‘bool (*)(int&, int&)’ (conversion) /usr/include/c++/11/bits/predefined_ops.h:158:30: note: candidate expects 3 arguments, 3 provided grafo_spalvinimas.cpp:54:48: note: candidate: ‘main()::<lambda(int&, int&)>’ 54 | sort(nodeOrder.begin()+1, nodeOrder.end(), [](auto &a, auto &b){ | ^ grafo_spalvinimas.cpp:54:48: note: no known conversion for argument 1 from ‘std::pair<int, int>’ to ‘int&’ In file included from /usr/include/c++/11/bits/stl_algobase.h:71, from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/sstream:38, from /usr/include/c++/11/complex:45, from /usr/include/c++/11/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54, from grafo_spalvinimas.cpp:1: /usr/include/c++/11/bits/predefined_ops.h: In instantiation of ‘bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = std::pair<int, int>; _Iterator = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Compare = main()::<lambda(int&, int&)>]’: /usr/include/c++/11/bits/stl_algo.h:1806:20: required from ‘void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Compare = __gnu_cxx::__ops::_Val_comp_iter<main()::<lambda(int&, int&)> >]’ /usr/include/c++/11/bits/stl_algo.h:1834:36: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda(int&, int&)> >]’ /usr/include/c++/11/bits/stl_algo.h:1866:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda(int&, int&)> >]’ /usr/include/c++/11/bits/stl_algo.h:1957:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda(int&, int&)> >]’ /usr/include/c++/11/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Compare = main()::<lambda(int&, int&)>]’ grafo_spalvinimas.cpp:54:9: required from here /usr/include/c++/11/bits/predefined_ops.h:240:30: error: no match for call to ‘(main()::<lambda(int&, int&)>) (std::pair<int, int>&, std::pair<int, int>&)’ 240 | { return bool(_M_comp(__val, *__it)); } | ~~~~~~~^~~~~~~~~~~~~~ /usr/include/c++/11/bits/predefined_ops.h:240:30: note: candidate: ‘bool (*)(int&, int&)’ (conversion) /usr/include/c++/11/bits/predefined_ops.h:240:30: note: candidate expects 3 arguments, 3 provided grafo_spalvinimas.cpp:54:48: note: candidate: ‘main()::<lambda(int&, int&)>’ 54 | sort(nodeOrder.begin()+1, nodeOrder.end(), [](auto &a, auto &b){ | ^ grafo_spalvinimas.cpp:54:48: note: no known conversion for argument 1 from ‘std::pair<int, int>’ to ‘int&’ In file included from /usr/include/c++/11/bits/stl_algobase.h:71, from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/istream:38, from /usr/include/c++/11/sstream:38, from /usr/include/c++/11/complex:45, from /usr/include/c++/11/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54, from grafo_spalvinimas.cpp:1: /usr/include/c++/11/bits/predefined_ops.h: In instantiation of ‘bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value&) [with _Iterator = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Value = std::pair<int, int>; _Compare = main()::<lambda(int&, int&)>]’: /usr/include/c++/11/bits/stl_heap.h:139:48: required from ‘void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Distance = long int; _Tp = std::pair<int, int>; _Compare = __gnu_cxx::__ops::_Iter_comp_val<main()::<lambda(int&, int&)> >]’ /usr/include/c++/11/bits/stl_heap.h:246:23: required from ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Distance = long int; _Tp = std::pair<int, int>; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda(int&, int&)> >]’ /usr/include/c++/11/bits/stl_heap.h:355:22: required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda(int&, int&)> >]’ /usr/include/c++/11/bits/stl_algo.h:1646:23: required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda(int&, int&)> >]’ /usr/include/c++/11/bits/stl_algo.h:1917:25: required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda(int&, int&)> >]’ /usr/include/c++/11/bits/stl_algo.h:1933:27: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda(int&, int&)> >]’ /usr/include/c++/11/bits/stl_algo.h:1954:25: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<main()::<lambda(int&, int&)> >]’ /usr/include/c++/11/bits/stl_algo.h:4875:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >; _Compare = main()::<lambda(int&, int&)>]’ grafo_spalvinimas.cpp:54:9: required from here /usr/include/c++/11/bits/predefined_ops.h:196:30: error: no match for call to ‘(main()::<lambda(int&, int&)>) (std::pair<int, int>&, std::pair<int, int>&)’ 196 | { return bool(_M_comp(*__it, __val)); } | ~~~~~~~^~~~~~~~~~~~~~ /usr/include/c++/11/bits/predefined_ops.h:196:30: note: candidate: ‘bool (*)(int&, int&)’ (conversion) /usr/include/c++/11/bits/predefined_ops.h:196:30: note: candidate expects 3 arguments, 3 provided grafo_spalvinimas.cpp:54:48: note: candidate: ‘main()::<lambda(int&, int&)>’ 54 | sort(nodeOrder.begin()+1, nodeOrder.end(), [](auto &a, auto &b){ | ^ grafo_spalvinimas.cpp:54:48: note: no known conversion for argument 1 from ‘std::pair<int, int>’ to ‘int&’
nr. | result | time | message |
---|