题目:分数线划定 https://xinyoudui.com/ac/contest/747003D6600053401A35FF6/problem/6760
#include<bits/stdc++.h>
#define f first
#define s second
using namespace std;
bool cmp(pair<int,int>a,pair<int,int>b){
if(a.s==b.s)return a.f<b.f;
return a.s>b.s;
}int main(){
vector<pair<int,int> >a,b;
int n,m,p=0;
cin>>n>>m;
for(int i=0;i<n;i++)cin>>a[i].f>>a[i].s;
sort(a.begin(),a.end(),cmp);
b=a;
unique(b.begin(),b.end());
cout<<b[m-1].s<<" ";
for(pair<int,int> i:a){
p++;
if(i.s<b[m-1].s){
cout<<p-1<<"\n";
break;
}
}for(int i=0;i<p;i++)cout<<a[i].f<<" "<<a[i].s<<"\n";
return 0;
}