Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #pragma GCC optimize("-Ofast")
- #pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native")
- #pragma GCC optimize("-ffast-math")
- #pragma GCC optimize("-funroll-loops")
- #pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loops")
- #define IO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
- const long long MOD = 1e9 + 7, OO = 1e18;
- const double PI = acos(-1);
- const int N = 1e6 + 5;
- const int dx[4] = {0, 0, 1, -1};
- const int dy[4] = {1, -1, 0, 0};
- long long n;
- string s1, s2;
- map<string, string>mp;
- int main()
- {
- IO
- cin >> n;
- cin.ignore();
- while (n--)
- {
- getline(cin, s1);
- getline(cin, s2);
- mp[s1] = s2;
- }
- cin >> n;
- cin.ignore();
- while (n--)
- {
- getline(cin, s1);
- cout << mp[s1] << '\n';
- }
- // long long x;
- // string s1, s2;
- // cin >> x;
- // cin.ignore();
- // cout << "string1 = ";
- // getline(cin, s1);
- // cout << "string2 = ";
- // getline(cin, s2);
- // cout << s1 << '\n' << s2;
- // map<long long, long long>mp;
- // // key = long long, value = long long;
- // mp[5] = 6;
- // // mp[key] = value
- // // cout << mp[key] => value
- // cout << mp[5] << '\n';
- // map<pair<long long, long long>, string>mp;
- // mp[{1, 1}] = "mahmoud";
- // cout << mp[{1, 1}];
- // map<long long, long long>mp;
- // mp[5] = 6;
- // cout << mp[5];
- // cout << '\n' << mp[4];
- return 0;
- }
- /*
- */
Advertisement
Add Comment
Please, Sign In to add comment