真的没什么好做的……
#include <stdio.h>
int queue[10005];
int main(){
int n,index,stu,grade;
scanf("%d",&n);
for(int i = 0; i < n; i++){
scanf("%d-%d %d",&index,&stu,&grade);
queue[index] += grade;
}
int max = 0;
int i;
for(i = 0; i < 1001; i++){
if(queue[i] > queue[max])
max = i;
}
printf("%d %d\n",max,queue[max]);
return 0;
}