#include<iostream>
#include<algorithm>
#include<map>
#include<string>
using namespace std;
int main()
{
int a, b, c, n;
cin >> n;
int team[1001] = {0};
for (int i = 0; i < n; i++)
{
scanf("%d-%d %d",&a,&b,&c);
team[a] = team[a] + c;
}
int max = 0,i=0;
for ( i = 0; i < 1001; i++)
{
if (team[max] < team[i])
max = i;
}
cout << max << " " << team[max];
system("pause");
return 0;
}
PAT 乙级 1047 编程团体赛 (20分)
最新推荐文章于 2023-11-07 11:09:38 发布