-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path9322.cpp
More file actions
47 lines (33 loc) · 787 Bytes
/
9322.cpp
File metadata and controls
47 lines (33 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include<iostream>
#include<algorithm>
#include<unordered_map>
#include<cstring>
using namespace std;
int main(void)
{
ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int T; cin >> T;
while (T--) {
unordered_map<string, int>ma;
int change[1001];
string tran[1001];
int n; cin >> n;
for (int i = 1; i <= n; i++) {
string key1; cin >> key1;
ma[key1] = i;
}
for (int i = 1; i <= n; i++) {
string key2; cin >> key2;
change[i] = ma[key2];
//change[a] = b; --> a번째 단어를 b 번째로 옮겨야 함
}
for (int i = 1; i <= n; i++) {
string temp; cin >> temp;
tran[change[i]] = temp;
}
for (int i = 1; i <= n; i++) {
cout << tran[i] << " ";
}
cout << "\n";
}
}