0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-28 14:31:58 +00:00

C - Poem Online Judge

https://atcoder.jp/contests/abc251/submissions/31669538
This commit is contained in:
Baoshuo Ren 2022-05-14 20:21:34 +08:00
parent ad33854e63
commit 892ccd3d03
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

33
AtCoder/ABC251/C/C.cpp Normal file
View File

@ -0,0 +1,33 @@
#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;
}