You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
619 B

#include <bits/stdc++.h>
using namespace std;
int main() {
//输入+输出重定向
//freopen("../x.in", "r", stdin);
//freopen("../x.out", "w", stdout);
int n;
cin >> n;
unordered_map<string, int> _map;
for (int i = 0; i < n; ++i) {
string word;
int page;
cin >> word >> page;
_map[word] = page;
}
int m;
cin >> m;
for (int i = 0; i < m; ++i) {
string word;
cin >> word;
cout << _map[word] << endl;
}
//关闭文件
//fclose(stdin);
//fclose(stdout);
return 0;
}