• + 1 comment

    I had the same problem, thanks for the heads up. Here's my final solution.

    int main() {
        long long T;
        string query;
        cin >> T;
    
        map <string, string> phonebook;
        while(T--){
          string name, phonenumber;
          cin >> name >> phonenumber;
          phonebook[name] = phonenumber;
        }
    
        while(cin >> query){
          if (phonebook[query] != "")
            cout << query << "=" << phonebook[query] << endl;
          else
            cout << "Not found" << endl;
        }
        return 0;
    }