QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#443587 | #7944. Max Minus Min | ZhaoZiLong | Compile Error | / | / | C++17 | 935b | 2024-06-15 16:01:33 | 2024-06-15 16:01:33 |
Due to the privacy settings of the submitter, you are not allowed to view this code.
Details
answer.code:12:10: error: reference to ‘data’ is ambiguous 12 | bool cmp(data a,data b) | ^~~~ In file included from /usr/include/c++/13/string:53, from /usr/include/c++/13/bitset:52, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52, from answer.code:1: /usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)’ 346 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/13/bits/range_access.h:336:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’ 336 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/13/bits/range_access.h:325:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’ 325 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/13/bits/range_access.h:314:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’ 314 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ answer.code:7:8: note: ‘struct data’ 7 | struct data | ^~~~ answer.code:12:17: error: reference to ‘data’ is ambiguous 12 | bool cmp(data a,data b) | ^~~~ /usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)’ 346 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/13/bits/range_access.h:336:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’ 336 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/13/bits/range_access.h:325:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’ 325 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/13/bits/range_access.h:314:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’ 314 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ answer.code:7:8: note: ‘struct data’ 7 | struct data | ^~~~ answer.code:12:23: error: expression list treated as compound expression in initializer [-fpermissive] 12 | bool cmp(data a,data b) | ^ In file included from /usr/include/c++/13/bits/stl_algobase.h:71, from /usr/include/c++/13/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51: /usr/include/c++/13/bits/predefined_ops.h: In instantiation of ‘constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = data*; _Iterator2 = data*; _Compare = bool]’: /usr/include/c++/13/bits/stl_algo.h:1819:14: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = data*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool>]’ /usr/include/c++/13/bits/stl_algo.h:1859:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = data*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool>]’ /usr/include/c++/13/bits/stl_algo.h:1950:31: required from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = data*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool>]’ /usr/include/c++/13/bits/stl_algo.h:4894:18: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = data*; _Compare = bool]’ answer.code:54:7: required from here /usr/include/c++/13/bits/predefined_ops.h:158:30: error: expression cannot be used as a function 158 | { return bool(_M_comp(*__it1, *__it2)); } | ~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/predefined_ops.h: In instantiation of ‘bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = data; _Iterator = data*; _Compare = bool]’: /usr/include/c++/13/bits/stl_algo.h:1799:20: required from ‘void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = data*; _Compare = __gnu_cxx::__ops::_Val_comp_iter<bool>]’ /usr/include/c++/13/bits/stl_algo.h:1827:36: required from ‘void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = data*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool>]’ /usr/include/c++/13/bits/stl_algo.h:1859:25: required from ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [...