POINTS giving WA

please help!!!
http://www.codechef.com/viewsolution/7269312
its giving wrong answer…

You are sorting two times and differently this makes the number pair different.try sorting them at once and change the second data if first is equal in the compare function.for eg.

sort(p,p+n,cmp);

inline bool cmp(pair<int,int> x, pair<int,int>y){

if(x.first!=y.first)
	return x.first< y.first;
else
	return x.second> y.second;

}

1 Like

thanks…
but u r little bit late…
i have corrected it already…

1 Like

ahh well sorry…

1 Like

no need…thanks anyway…atleast you read the question and answer it…

1 Like
//