https://pintia.cn/problem-sets/994805260223102976/problems/994805281567916032
简单题。
#include<iostream>
using namespace std;
int main() {
int n, m, temp, p;
cin >> n;
int shi[n];
string str[n][2];
for(int i=0; i<n; i++){
cin >> str[i][0];
cin >> temp;
cin >> str[i][1];
shi[temp] = i;
}
cin >> m;
for(int i=0; i<m; i++){
cin >> p;
cout << str[shi[p]][0] << " " << str[shi[p]][1] << endl;
}
}