Tuesday, 23 June 2015

STRUCTURE SORT



FIRST INCREASING SECOND DECREASING

bool cmp(pair<int,int> x,pair<int,int> y)
{
    if(x.first==y.first)
    {
        return x.second>y.second;
    }
    else
        return x.first<y.first;
}

 sort(p,p+n,cmp);


No comments:

Post a Comment