OI常用重载运算符

用STL时经常用到

PS:这里有个巨坑,把重载写在STL里常数会爆炸,分分钟大数据TLE

所以就把重载放在结构体里啦

//以按b降序为例
struct uct {
    int a,b; 
    bool operator<(nde uuz) const{
        return val>uuz.val;
    }
};
View Code

猜你喜欢

转载自www.cnblogs.com/sun123zxy/p/operator.html
今日推荐