运行 ID: 75225

Main.cc: In function ‘int main()’:
Main.cc:19:47: error: use of ‘auto’ in lambda parameter declaration only available with -std=c++14 or -std=gnu++14
     sort(roofs.begin(), roofs.end(), [](const auto& a, const auto& b) {
                                               ^~~~
Main.cc:19:62: error: use of ‘auto’ in lambda parameter declaration only available with -std=c++14 or -std=gnu++14
     sort(roofs.begin(), roofs.end(), [](const auto& a, const auto& b) {
                                                              ^~~~
Main.cc: In lambda function:
Main.cc:20:24: error: request for member ‘first’ in ‘a’, which is of non-class type ‘const int’
         return hypot(a.first.first, a.first.second) < hypot(b.first.first, b.first.second);
                        ^~~~~
Main.cc:20:39: error: request for member ‘first’ in ‘a’, which is of non-class type ‘const int’
         return hypot(a.first.first, a.first.second) < hypot(b.first.first, b.first.second);
                                       ^~~~~
Main.cc:20:63: error: request for member ‘first’ in ‘b’, which is of non-class type ‘const int’
         return hypot(a.first.first, a.first.second) < hypot(b.first.first, b.first.second);
                                                               ^~~~~
Main.cc:20:78: error: request for member ‘first’ in ‘b’, which is of non-class type ‘const int’
         return hypot(a.first.first, a.first.second) < hypot(b.first.first, b.first.second);
                                                                              ^~~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:71:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from Main.cc:2:
/usr/include/c++/7/bits/predefined_ops.h: In instantiation of ‘bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Iterator2 = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Compare = main()::]’:
/usr/include/c++/7/bits/stl_algo.h:1847:14:   required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’
/usr/include/c++/7/bits/stl_algo.h:1885:25:   required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’
/usr/include/c++/7/bits/stl_algo.h:1971:31:   required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’
/usr/include/c++/7/bits/stl_algo.h:4868:18:   required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Compare = main()::]’
Main.cc:21:6:   required from here
/usr/include/c++/7/bits/predefined_ops.h:143:18: error: no match for call to ‘(main()::) (std::pair, int>&, std::pair, int>&)’
         { return bool(_M_comp(*__it1, *__it2)); }
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/7/bits/predefined_ops.h:143:18: note: candidate: void (*)(const int&, const int&) 
/usr/include/c++/7/bits/predefined_ops.h:143:18: note:   candidate expects 3 arguments, 3 provided
Main.cc:19:69: note: candidate: main()::
     sort(roofs.begin(), roofs.end(), [](const auto& a, const auto& b) {
                                                                     ^
Main.cc:19:69: note:   no known conversion for argument 1 from ‘std::pair, int>’ to ‘const int&’
In file included from /usr/include/c++/7/bits/stl_algobase.h:71:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from Main.cc:2:
/usr/include/c++/7/bits/predefined_ops.h: In instantiation of ‘bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = std::pair, int>; _Iterator = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Compare = main()::]’:
/usr/include/c++/7/bits/stl_algo.h:1828:20:   required from ‘void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Compare = __gnu_cxx::__ops::_Val_comp_iter >]’
/usr/include/c++/7/bits/stl_algo.h:1855:36:   required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’
/usr/include/c++/7/bits/stl_algo.h:1885:25:   required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’
/usr/include/c++/7/bits/stl_algo.h:1971:31:   required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’
/usr/include/c++/7/bits/stl_algo.h:4868:18:   required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Compare = main()::]’
Main.cc:21:6:   required from here
/usr/include/c++/7/bits/predefined_ops.h:215:11: error: no match for call to ‘(main()::) (std::pair, int>&, std::pair, int>&)’
  { return bool(_M_comp(__val, *__it)); }
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/7/bits/predefined_ops.h:215:11: note: candidate: void (*)(const int&, const int&) 
/usr/include/c++/7/bits/predefined_ops.h:215:11: note:   candidate expects 3 arguments, 3 provided
Main.cc:19:69: note: candidate: main()::
     sort(roofs.begin(), roofs.end(), [](const auto& a, const auto& b) {
                                                                     ^
Main.cc:19:69: note:   no known conversion for argument 1 from ‘std::pair, int>’ to ‘const int&’
In file included from /usr/include/c++/7/bits/stl_algobase.h:71:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from Main.cc:2:
/usr/include/c++/7/bits/predefined_ops.h: In instantiation of ‘bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value&) [with _Iterator = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Value = std::pair, int>; _Compare = main()::]’:
/usr/include/c++/7/bits/stl_heap.h:133:48:   required from ‘void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Distance = long int; _Tp = std::pair, int>; _Compare = __gnu_cxx::__ops::_Iter_comp_val >]’
/usr/include/c++/7/bits/stl_heap.h:237:23:   required from ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Distance = long int; _Tp = std::pair, int>; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’
/usr/include/c++/7/bits/stl_heap.h:342:22:   required from ‘void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’
/usr/include/c++/7/bits/stl_algo.h:1672:23:   required from ‘void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’
/usr/include/c++/7/bits/stl_algo.h:1933:25:   required from ‘void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’
/usr/include/c++/7/bits/stl_algo.h:1948:27:   required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’
/usr/include/c++/7/bits/stl_algo.h:1968:25:   required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter >]’
/usr/include/c++/7/bits/stl_algo.h:4868:18:   required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator, int>*, std::vector, int> > >; _Compare = main()::]’
Main.cc:21:6:   required from here
/usr/include/c++/7/bits/predefined_ops.h:177:11: error: no match for call to ‘(main()::) (std::pair, int>&, std::pair, int>&)’
  { return bool(_M_comp(*__it, __val)); }
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/7/bits/predefined_ops.h:177:11: note: candidate: void (*)(const int&, const int&) 
/usr/include/c++/7/bits/predefined_ops.h:177:11: note:   candidate expects 3 arguments, 3 provided
Main.cc:19:69: note: candidate: main()::
     sort(roofs.begin(), roofs.end(), [](const auto& a, const auto& b) {
                                                                     ^
Main.cc:19:69: note:   no known conversion for argument 1 from ‘std::pair, int>’ to ‘const int&’