diff --git a/AtCoder/ABC251/C/C.cpp b/AtCoder/ABC251/C/C.cpp new file mode 100644 index 00000000..81605ed2 --- /dev/null +++ b/AtCoder/ABC251/C/C.cpp @@ -0,0 +1,33 @@ +#include +#include +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +int n; +std::string s; +std::unordered_map map; +std::pair 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; +}