B. Lecture【1000 / 字符串】
作者:互联网
https://codeforces.com/problemset/problem/499/B
#include<bits/stdc++.h>
using namespace std;
map<string,string>mp;
int main(void)
{
int n,m; cin>>n>>m;
for(int i=0;i<m;i++)
{
string a,b; cin>>a>>b;
if(a.size()<=b.size()) mp[a]=a,mp[b]=a;
else mp[a]=b,mp[b]=b;
}
string s;
getline(cin,s);
getline(cin,s);
stringstream l(s);
while(l>>s) cout<<mp[s]<<" ";
return 0;
}
标签:std,problemset,int,void,cin,字符串,Lecture,main,1000 来源: https://blog.csdn.net/bettle_king/article/details/120343755