#include<stdio.h>
struct sch
{
int school;
int score;
};
void main()
{
struct sch stu[100000];
int i,N,sum[100000]={0};
scanf("%d",&N);
for(i=0;i<N;i++){
scanf("%d%d",&stu[i].school,&stu[i].score);
sum[stu[i].school]+=stu[i].score;
}
int class=1;
int s=sum[1];
for(i=2;i<=N;i++){
if(sum[i]>s){
s=sum[i]^s;
sum[i]=sum[i]^s;
s=sum[i]^s;
class=i;
}
}
printf("%d %d\n",class,s);
}
PTA1032 挖掘机技术哪家强 (20 分)
最新推荐文章于 2024-08-21 21:35:15 发布