class mycmp{
public:
bool operator()(pair<int, string>& a, pair<int, string>& b)
{
return a.first > b.first;
// can write more code if required. depends upon requirement.
}
};
int main(){
priority_queue<pair<int,string>,vector<pair<int,string>,mycmp>pq;
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter