-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1620.cpp
More file actions
34 lines (29 loc) · 714 Bytes
/
1620.cpp
File metadata and controls
34 lines (29 loc) · 714 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
#include <bits/stdc++.h>
#define FastIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
using namespace std;
int main(void){
FastIO;
int n,m;
cin>>n>>m;// n:포켓몬수, m: 문제수
map<string, int> pocketmon1;
map<int,string> pocketmon2;
for(int i=1; i<=n; i++){
string s;
cin>>s;
pocketmon1[s]=i;
pocketmon2[i]=s;
}
for(int i=1; i<=m; i++){
string a;
cin >> a;
if(isdigit(a[0])){//숫자이면
cout<<pocketmon2[stoi(a)]<<"\n";
}
else{//문자열이면
cout<<pocketmon1[a]<<"\n";
}
}
}