0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-25 19:12:02 +00:00
OI-codes/AtCoder/ABC251/C/C.cpp

34 lines
555 B
C++

#include <iostream>
#include <string>
#include <unordered_map>
using std::cin;
using std::cout;
const char endl = '\n';
int n;
std::string s;
std::unordered_map<std::string, bool> map;
std::pair<int, int> ans;
int main() {
std::ios::sync_with_stdio(false);
cin >> n;
for (int i = 1, x; i <= n; i++) {
cin >> s >> x;
if (!map.count(s)) {
map[s] = true;
if (x > ans.first) {
ans = std::make_pair(x, i);
}
}
}
cout << ans.second << endl;
return 0;
}