/ WHOJ /

记录详情

Compile Error

foo.cc: In function 'bool cmp(node, node)':
foo.cc:14:14: error: 'struct node' has no member named 'c'
   14 |     return x.c<y.c;
      |              ^
foo.cc:14:18: error: 'struct node' has no member named 'c'
   14 |     return x.c<y.c;
      |                  ^
In file included from /usr/include/c++/9/bits/stl_algobase.h:71,
                 from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = Node*; _Iterator2 = Node*; _Compare = bool (*)(node, node)]':
/usr/include/c++/9/bits/stl_algo.h:1852:14:   required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = Node*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(node, node)>]'
/usr/include/c++/9/bits/stl_algo.h:1890:25:   required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = Node*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(node, node)>]'
/usr/include/c++/9/bits/stl_algo.h:1976:31:   required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = Node*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(node, node)>]'
/usr/include/c++/9/bits/stl_algo.h:4905:18:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = Node*; _Compare = bool (*)(node, node)]'
foo.cc:69:27:   required from here
/usr/include/c++/9/bits/predefined_ops.h:143:18: error: could not convert '* __it1' from 'Node' to 'node'
  143 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                  |
      |                  Node
/usr/include/c++/9/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = Node; _Iterator = Node*; _Compare = bool (*)(node, node)]':
/usr/include/c++/9/bits/stl_algo.h:1833:20:   required from 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = Node*; _Compare = __gnu_cxx::__ops::_Val_comp_iter<bool (*)(node, node)>]'
/usr/include/c++/9/bits/stl_algo.h:1860:36:   required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = Node*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(node, node)>]'
/usr/include/c++/9/bits/stl_algo.h:1890:25:   required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = Node*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(node, node)>]'
/usr/include/c++/9/bits/stl_algo.h:1976:31:   required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = Node*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(node, node)>]'
/usr/include/c++/9/bits/stl_algo.h:4905:18:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = Node*; _Compare = bool (*)(node, node)]'
foo.cc:69:27:   required from here
/usr/include/c++/9/bits/predefined_ops.h:215:11: error: could not convert '__val' from 'Node' to 'node'
  215 |  { return bool(_M_comp(__val, *__it)); }
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |           |
      |           Node
/usr/include/c++/9/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value&) [with _Iterator = Node*; _Value = Node; _Compare = bool (*)(node, node)]':
/usr/include/c++/9/bits/stl_heap.h:133:48:   required from 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = Node*; _Distance = long int; _Tp = Node; _Compare = __gnu_cxx::__ops::_Iter_comp_val<bool (*)(node, node)>]'
/usr/include/c++/9/bits/stl_heap.h:237:23:   required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = Node*; _Distance = long int; _Tp = Node; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(node, node)>]'
/usr/include/c++/9/bits/stl_heap.h:342:22:   required from 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = Node*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(node, node)>]'
/usr/include/c++/9/bits/stl_algo.h:1677:23:   required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = Node*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(node, node)>]'
/usr/include/c++/9/bits/stl_algo.h:1938:25:   required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = Node*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(node, node)>]'
/usr/include/c++/9/bits/stl_algo.h:1953:27:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = Node*; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(node, node)>]'
/usr/include/c++/9/bits/stl_algo.h:1973:25:   required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = Node*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(node, node)>]'
/usr/include/c++/9/bits/stl_algo.h:4905:18:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = Node*; _Compare = bool (*)(node, node)]'
foo.cc:69:27:   required from here
/usr/include/c++/9/bits/predefined_ops.h:177:11: error: could not convert '* __it' from 'Node' to 'node'
  177 |  { return bool(_M_comp(*__it, __val)); }
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |           |
      |           Node
Found 10 testcases.
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1122 [USACO07OPEN]City Horizon S
题目数据
下载
语言
C++
递交时间
2022-04-04 19:27:58
评测时间
2022-04-04 19:27:58
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes