About custom comparator

struct cmpa{
    bool operator ()(const int &i,const int &j){
        return a[i]<a[j];
    }
};

用priority_queue<int,vector When cmpa> q define the comparison function, contrary to the comparative example

That is if you want to be written in descending order <No.

Guess you like

Origin www.cnblogs.com/White-star/p/11529890.html