heap_size.cpp

 
a.cpp: In function 'void down(int)': a.cpp:10:14: error: reference to 'size' is ambiguous 10 | if (u*2<=size&&heap[u*2]<heap[u]) t=u*2; | ^~~~ In file included from /usr/include/c++/9/string:54, from /usr/include/c++/9/bits/locale_classes.h:40, from /usr/include/c++/9/bits/ios_base.h:41, from /usr/include/c++/9/ios:42, from /usr/include/c++/9/ostream:38, from /usr/include/c++/9/iostream:39, from a.cpp:1: /usr/include/c++/9/bits/range_access.h:252:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 252 | size(const _Tp (&/*__array*/)[_Nm]) noexcept | ^~~~ /usr/include/c++/9/bits/range_access.h:242:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 242 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cpp:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cpp:11:16: error: reference to 'size' is ambiguous 11 | if (u*2+1<=size&&heap[u*2+1]<heap[t]) t=u*2+1; | ^~~~ In file included from /usr/include/c++/9/string:54, from /usr/include/c++/9/bits/locale_classes.h:40, from /usr/include/c++/9/bits/ios_base.h:41, from /usr/include/c++/9/ios:42, from /usr/include/c++/9/ostream:38, from /usr/include/c++/9/iostream:39, from a.cpp:1: /usr/include/c++/9/bits/range_access.h:252:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 252 | size(const _Tp (&/*__array*/)[_Nm]) noexcept | ^~~~ /usr/include/c++/9/bits/range_access.h:242:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 242 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cpp:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cpp: In function 'void del_min()': a.cpp:20:18: error: reference to 'size' is ambiguous 20 | heap[1]=heap[size--]; | ^~~~ In file included from /usr/include/c++/9/string:54, from /usr/include/c++/9/bits/locale_classes.h:40, from /usr/include/c++/9/bits/ios_base.h:41, from /usr/include/c++/9/ios:42, from /usr/include/c++/9/ostream:38, from /usr/include/c++/9/iostream:39, from a.cpp:1: /usr/include/c++/9/bits/range_access.h:252:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 252 | size(const _Tp (&/*__array*/)[_Nm]) noexcept | ^~~~ /usr/include/c++/9/bits/range_access.h:242:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 242 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cpp:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cpp: In function 'void del_k(int)': a.cpp:26:18: error: reference to 'size' is ambiguous 26 | heap[u]=heap[size--]; | ^~~~
03-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值