#include<iostream>
#include <queue>
#include<string>
#include<vector>
#include<map>
#include<algorithm>
#include<math.h>
#include <iomanip>
#include <algorithm>
#pragma warning(disable:4996)
using namespace std;
struct wajueji
{
int bianhao;
int fenshu;
}w[100000];
bool cmp(wajueji a,wajueji b)
{
return a.fenshu>b.fenshu;
}
int main()
{
int a,h,f;
cin >> a;
for (int i = 0;i < a;i++)
{
w[i].bianhao = i+1;
w[i].fenshu = 0;
}
for (int i = 0;i < a;i++)
{
getchar();
cin >> h >> f;
w[h-1].fenshu+=f;
}
sort(&w[0],&w[a],cmp);
cout << w[0].bianhao << " " << w[0].fenshu;
}
1032 挖掘机技术哪家强 (20 分)
最新推荐文章于 2024-09-16 17:46:36 发布