What wrong in my code

#include
#include
using namespace std;
bool cmp(pair<string,int >s1,pair<string,int >s2){
if(s1.second==s2.second){
return s1.first < s2.first;
}
return s1.second>s2.second;}

int main() {
long long int p;
cin>>p;
long long int m;
cin>>m;
pair<string,long long int>mp[m];
long long int count=1;
string a;
long long int b;
for(long long int j=0;j<m;j++){
cin>>a>>b;
mp[j]=make_pair(a, b);;
}
sort(mp, mp+ m, cmp);
for(long long int j=0;j<m;j++){
if(mp[j].second>p)
cout<<mp[j].first<<" “<<mp[j].second<<”\n";
}

	cout<<"\n";

return 0;

}

@dineshjani please save your code on ide.codingblocks.com and share the link

hi @dineshjani your custom sort function is wrong. You are supposed to arrange according to the salary in DECREASING order and if salary is same then arrange names in INCREASING order but you are sorting everything in increasing order. You could clearly see that in custom test case as well. (I am referring to your latest submission since you did not save the code and share the link yourself). I am marking the doubt as resolved for now since you haven’t replied to it, you can always reopen it if you need to.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.