************************sort game

although the ans is correct…test cases are not getting passed

@ayu2321
hello ayushi,
pls share ur code

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.

#include
#include
#include
using namespace std;
bool compare(pair<string,int>p1,pair<string,int>p2){
if(p1.second!=p2.second)
{
return p1.second>p2.second;
}
else
{
return p1.first<p2.first;
}
}
int main() {

int min_salary,n;
pair<string,int>emp[1000];
string name;
int salary;
cin>>min_salary;
cin>>n;
for(int i=0;i<n;i++){
	cin>>name>>salary;
	emp[i].first = name;
	emp[i].second = salary;
}
sort(emp,emp+n,compare);

for(int i=0;i<n;i++){
	if(emp[i].second>min_salary){
			cout<<emp[i].first<<" ";
			cout<<emp[i].second<<endl;
	}

}
return 0;

}

@ayu2321

a) hello ayushi ,value of n can be upto 10^5 so declare ur array size bigger than that
b)

use >= in place of >

yes, now it is working fine…thank you