Language: C++

#include<iostream>
#include<map>
#include<string>

int main () {
  map<std::string,int> blue;
  map<std::string,int> data;
  map<std::string,int> red;
  int b_num, r_num;
  std::cin >> b_num >> r_num;
  for (int i=0; i<b_num; i++) {
    std::string str;
    std::cin >> str;
    data[str] = 1;
    if (!blue.count(str)) {
      blue[str] = 1;
    }
    else {
      blue.at(str)++;
    }
  }
  for (int i=0; i<r_num; i++) {
    std::string str;
    std::cin >> str;
    data[str] = 1;
    if (!red.count(str)) {
      blue[str] = 1;
    }
    else {
      red.at(str)++;
    }
  }
  int sum = 0;
  for (auto p: data) {
    auto key = data.first;
    if (blue.count(key)) {
      sum += blue.at(key);
    }
    if (red.count(key)) {
      sum -= red.at(key);
    }
  }
  std::cout << sum << sd::endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'map' was not declared in this scope
    6 |   map<std::string,int> blue;
      |   ^~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/map:63,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_map.h:102:11: note:   'std::map'
  102 |     class map
      |           ^~~
/usr/include/c++/14/map:89:13: note:   'std::pmr::map'
   89 |       using map
      |             ^~~
a.cc:6:18: error: expected primary-expression before ',' token
    6 |   map<std::string,int> blue;
      |                  ^
a.cc:6:19: error: expected primary-expression before 'int'
    6 |   map<std::string,int> blue;
      |                   ^~~
a.cc:7:18: error: expected primary-expression before ',' token
    7 |   map<std::string,int> data;
      |                  ^
a.cc:7:19: error: expected primary-expression before 'int'
    7 |   map<std::string,int> data;
      |                   ^~~
a.cc:8:18: error: expected primary-expression before ',' token
    8 |   map<std::string,int> red;
      |                  ^
a.cc:8:19: error: expected primary-expression before 'int'
    8 |   map<std::string,int> red;
      |                   ^~~
a.cc:14:5: error: 'data' was not declared in this scope; did you mean 'std::data'?
   14 |     data[str] = 1;
      |     ^~~~
      |     std::data
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: 'std::data' declared here
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
a.cc:15:10: error: 'blue' was not declared in this scope
   15 |     if (!blue.count(str)) {
      |          ^~~~
a.cc:25:5: error: 'data' was not declared in this scope; did you mean 'std::data'?
   25 |     data[str] = 1;
      |     ^~~~
      |     std::data
/usr/include/c++/14/bits/range_access.h:344:5: note: 'std::data' declared here
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
a.cc:26:10: error: 'red' was not declared in this scope
   26 |     if (!red.count(str)) {
      |          ^~~
a.cc:27:7: error: 'blue' was not declared in this scope
   27 |       blue[str] = 1;
      |       ^~~~
a.cc:34:16: error: 'data' was not declared in this scope; did you mean 'std::data'?
   34 |   for (auto p: data) {
      |                ^~~~
      |                std::data
/usr/include/c++/14/bits/range_access.h:344:5: note: 'std::data' declared here
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
a.cc:36:9: error: 'blue' was not declared in this scope
   36 |     if (blue.count(key)) {
      |         ^~~~
a.cc:39:9: error: 'red' was not declared in this scope
   39 |     if (red.count(key)) {
      |         ^~~
a.cc:43:23: error: 'sd' has not been declared
   43 |   std::cout << sum << sd::endl;
      |                       ^~