摘要: struct node { int x,y,val; bool operator <(const node &a) const { return val<a.val; } }; &a表示引用,避免比较时创建新的对象,提升比较效率。 第一个const避免对象参数被改变,第二个const表示函数不会修改 阅读全文
posted @ 2024-11-18 23:04 _窗帘 阅读(26) 评论(0) 推荐(0)