02 July 2015

UVA 12592 - Slogan Learning of Prin.. (STL MAP)

/***
Md. Namzul Hasan
Shahjalal University of Science & technology,sylhet.
hasan08sust@gmail.com
Problem id : 12592
verdict: accepted
***/

#include<iostream>
#include<cstdio>
#include<cstring>
#include<stack>
#include<queue>
#include<algorithm>
#include<vector>
#include<cmath>
#include<cctype>
#include<sstream>
#include<stdlib.h>
#include<map>
using namespace std ;
typedef long long ll ;
typedef int in ;
typedef unsigned long long ull ;
const double pi = 2*acos(0) ;
#define maxi 40000
#define pf printf
#define sc scanf
#define pb push_back
#define MEM(x,y) (memset((x),(y),sizeof(x)))
#define MIN(x,y) ((x) < (y) ? (x) : (y))
#define MAX(x,y) ((x) > (y) ? (x) : (y))

string str1 , str2 , str ;
map<string,string>mp ;

int main()
{

    in slogan ;
    cin>>slogan ;
    getchar() ;
    while(slogan--)
    {
        getline(cin,str1) ;
        getline(cin,str2) ;
        mp[str1] = str2 ;
    }
    in n ;
    cin>>n ;
    getchar() ;
    while(n--)
    {
        getline(cin,str) ;
        cout<<mp[str]<<endl ;
    }
    mp.clear() ;
    return 0 ;
}

No comments:

Post a Comment

UVA 10679 - I Love Strings!!