mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-27 13:16:26 +00:00
C - Poem Online Judge
https://atcoder.jp/contests/abc251/submissions/31669538
This commit is contained in:
parent
ad33854e63
commit
892ccd3d03
33
AtCoder/ABC251/C/C.cpp
Normal file
33
AtCoder/ABC251/C/C.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user