Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
- using namespace std;
- int main()
- {
- optimize();
- int n,m;
- cin>>n>>m;
- map<string,string>mp;
- for(int i=0;i<n;i++)
- {
- string s1,s2;
- cin>>s1>>s2;
- s2+=';';
- mp[s1]=s2;
- }
- for(int i=0;i<m;i++)
- {
- string s3,s4;
- cin>>s3>>s4;
- for(auto u:mp)
- {
- if(u.second==s4) cout<<s3<<" "<<s4<<" #"<<u.first<<endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement