//知道为什么几次提交都是WA了,原来是struct没有初始化,对于任何程序,细节决定成败
#include<iostream>
#include<algorithm>
using namespace std;
#define SIZE 50010
struct vote
{
vote(): a(0),b(0),num(0){};
int a;
int b;
int num;
};
int cmp1(vote t1,vote t2)
{
return t1.a>t2.a;
}
int cmp2(vote t1,vote t2)
{
return t1.b>t2.b;
}
int main()
{
vote cow[SIZE];
int m,n;
cin>>m>>n;
for(int i=0;i<m;++i){
cin>>cow[i].a>>cow[i].b;
cow[i].num=i+1;
}
sort(cow,cow+m,cmp1);
sort(cow,cow+n,cmp2);
cout<<cow[0].num<<endl;
return 0;
}
POJ3664
最新推荐文章于 2021-02-20 19:09:19 发布