您的位置:首页 > 其它

H - Election Time POJ - 3664

2017-05-05 21:00 351 查看


H - Election Time

 POJ - 3664 

#include <iostream>
#include <algorithm>
#include <map>
using namespace std;

struct cow{
int a,b,id;
};
bool cnt1(cow c1,cow c2)
{
return c1.a>c2.a;
}
bool cnt2(cow c1,cow c2)
{
return c1.b>c2.b;
}

int main()
{
int N,k; cow ss[50000+5];
ios::sync_with_stdio(false);
cin>>N>>k;
for(int i=0;i<N;i++){
cin>>ss[i].a>>ss[i].b;
ss[i].id=i+1;
}
sort(ss,ss+N,cnt1);
sort(ss,ss+k,cnt2);
cout<<ss[0].id<<endl;
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: