用STL时经常用到
PS:这里有个巨坑,把重载写在STL里常数会爆炸,分分钟大数据TLE
所以就把重载放在结构体里啦


//以priority_queue的重载为例 //priority_queue默认大根堆 struct uct { int a,b; bool operator<(nde uuz) const{ return val>uuz.val; } };
用STL时经常用到
PS:这里有个巨坑,把重载写在STL里常数会爆炸,分分钟大数据TLE
所以就把重载放在结构体里啦
//以priority_queue的重载为例 //priority_queue默认大根堆 struct uct { int a,b; bool operator<(nde uuz) const{ return val>uuz.val; } };
转载于:https://www.cnblogs.com/sun123zxy/p/operator.html