0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-24 06:28:47 +00:00
OI-codes/AtCoder/ABC251/C/C.cpp

34 lines
555 B
C++
Raw Normal View History

#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;
}