I am trying to keep the elements of a set<pair<ll,pair<ll,ll> > > st
in descending order according to the following logic:
bool comp(pair<ll,pair<ll,ll> > a, pair<ll,pair<ll,ll> > b){
if(a.first!=b.first)
return a.first > b.first;
return a.second.first > b.second.first;
}
On declaring the set using : set<pair<ll,pair<ll,ll> > , comp> st;
It gives the following error:
error: template argument for template type parameter must be a type
Usually when sorting a vector we do : sort(v.begin(),v.end(),comp)
assuming that v is a vector of pair<ll,pair<ll,ll> >
How do the two cases differ and how should the I correctly execute the logic?