criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;

 int n,m,counter,subcounter,lapcounter;
 string strn,strm;
 cin >> n;
 counter = 0;
 subcounter = 0;
 vector<string> vecn(0);
 vector<string> vecm(0);
 for (int i = 0; i < n; i++) {
   cin >> strn;
   vecn.push_back(strn);
 }
 cin >> m;
 for (int i = 0; i < m; i++) {
   cin >> strm;
   vecm.push_back(strm);
 }
 for (int i = 0; i < m; i++) {
   for (int j = 0; j < m; j++) {
     if  (vecm.at(i-1) == vecm.at(j-1)) {
       counter++;
     }
   }
   for (int j = 0; j < n; j++) {
     if (vecm.at(i-1) == vecn.at(j-1)) {
       counter = counter -1;
     }
   }
 }
 if (counter > subcounter) {
   subcounter = counter;
 }
 if (subcounter =< 0 ) {
   subcounter = 0;
 }
 cout << subcounter ;
}

Compiler output:
a.cc:6:2: error: 'cin' does not name a type
    6 |  cin >> n;
      |  ^~~
a.cc:7:2: error: 'counter' does not name a type
    7 |  counter = 0;
      |  ^~~~~~~
a.cc:8:2: error: 'subcounter' does not name a type
    8 |  subcounter = 0;
      |  ^~~~~~~~~~
a.cc:11:2: error: expected unqualified-id before 'for'
   11 |  for (int i = 0; i < n; i++) {
      |  ^~~
a.cc:11:18: error: 'i' does not name a type
   11 |  for (int i = 0; i < n; i++) {
      |                  ^
a.cc:11:25: error: 'i' does not name a type
   11 |  for (int i = 0; i < n; i++) {
      |                         ^
a.cc:15:2: error: 'cin' does not name a type
   15 |  cin >> m;
      |  ^~~
a.cc:16:2: error: expected unqualified-id before 'for'
   16 |  for (int i = 0; i < m; i++) {
      |  ^~~
a.cc:16:18: error: 'i' does not name a type
   16 |  for (int i = 0; i < m; i++) {
      |                  ^
a.cc:16:25: error: 'i' does not name a type
   16 |  for (int i = 0; i < m; i++) {
      |                         ^
a.cc:20:2: error: expected unqualified-id before 'for'
   20 |  for (int i = 0; i < m; i++) {
      |  ^~~
a.cc:20:18: error: 'i' does not name a type
   20 |  for (int i = 0; i < m; i++) {
      |                  ^
a.cc:20:25: error: 'i' does not name a type
   20 |  for (int i = 0; i < m; i++) {
      |                         ^
a.cc:32:2: error: expected unqualified-id before 'if'
   32 |  if (counter > subcounter) {
      |  ^~
a.cc:35:2: error: expected unqualified-id before 'if'
   35 |  if (subcounter =< 0 ) {
      |  ^~
a.cc:38:2: error: 'cout' does not name a type
   38 |  cout << subcounter ;
      |  ^~~~
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <map>
 
using namespace std;
 
void addWordCount(const vector<string>& cards, map<string, int>& wordCount);
void subWordCount(const vector<string>& cards, map<string, int>& wordCount);
int getMaxValue(const map<string, int>& wordCount);
 
 
int main() {
    int numOfBlueCard = 0;
    cin >> numOfBlueCard;
    vector<string> blueCards;
    for (int i = 0; i < numOfBlueCard; ++i) {
        string blueCard;
        cin >> blueCard;
        blueCards.push_back(blueCard);
    }
 
    int numOfRedCard = 0;
    cin >> numOfRedCard;
    vector<string> redCards;
    for (int i = 0; i < numOfRedCard; ++i) {
        string redCard;
        cin >> redCard;
        redCards.push_back(redCard);
    }
    
    map<string, int> wordCount;
    addWordCount(blueCards, wordCount);
    subWordCount(redCards, wordCount);
    
    auto x = std::max_element(wordCount.begin(), wordCount.end(),
    [](const pair<string, int>& p1, const pair<string, int>& p2) {
        return p1.second < p2.second; });
    
    cout << x->second << endl;
}
 
void addWordCount(const vector<string>& cards, map<string, int>& wordCount) {
    for (string card : cards) {
        ++wordCount[card];
    }
}
 
void subWordCount(const vector<string>& cards, map<string, int>& wordCount) {
    for (string card : cards) {
        --wordCount[card];
    }
}
 
int getMaxValue(const map<string, int>& wordCount) {
    int maxValue = 0;
    for (auto word : wordCount) {
        if (word.second > maxValue) maxValue = word.second;
    }
    return maxValue;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:36:19: error: 'max_element' is not a member of 'std'; did you mean 'tuple_element'?
   36 |     auto x = std::max_element(wordCount.begin(), wordCount.end(),
      |                   ^~~~~~~~~~~
      |                   tuple_element
Language: C++

#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<string> blue(n);
    for (int i = 0; i < n; i++) {
        cin >> blue[i];
    }
    int m;
    cin >> m;
    vector<string> red(m);
    for (int i = 0; i < m; i++) {
        cin >> red[i];
    }

    int ans = 0;
    int calc = [&](string s) {
        int buf = 0;
        for (string t: blue) {
            if (t == s) buf++;
        }
        for (string t: red) {
            if (t == s) buf--;
        }
        return buf;
    };

    for (string t: blue) {
        ans = max(ans, calc(t));
    }

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:16: error: cannot convert 'main()::<lambda(std::string)>' to 'int' in initialization
   22 |     int calc = [&](string s) {
      |                ^~~~~~~~~~~~~~~
      |                |
      |                main()::<lambda(std::string)>
   23 |         int buf = 0;
      |         ~~~~~~~~~~~~
   24 |         for (string t: blue) {
      |         ~~~~~~~~~~~~~~~~~~~~~~
   25 |             if (t == s) buf++;
      |             ~~~~~~~~~~~~~~~~~~
   26 |         }
      |         ~       
   27 |         for (string t: red) {
      |         ~~~~~~~~~~~~~~~~~~~~~
   28 |             if (t == s) buf--;
      |             ~~~~~~~~~~~~~~~~~~
   29 |         }
      |         ~       
   30 |         return buf;
      |         ~~~~~~~~~~~
   31 |     };
      |     ~           
a.cc:34:28: error: 'calc' cannot be used as a function
   34 |         ans = max(ans, calc(t));
      |                        ~~~~^~~
Language: C++

#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<string> blue(n);
    for (int i = 0; i < n; i++) {
        cin >> blue[i];
    }
    int m;
    cin >> m;
    vector<string> red(m);
    for (int i = 0; i < m; i++) {
        cin >> red[i];
    }

    int ans = 0;
    auto calc = (string s) {
        int buf = 0;
        for (string t: blue) {
            if (t == s) buf++;
        }
        for (string t: red) {
            if (t == s) buf--;
        }
        return buf;
    };

    for (string t: blue) {
        ans = max(ans, calc(t));
    }

    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:25: error: expected primary-expression before 's'
   22 |     auto calc = (string s) {
      |                         ^
a.cc:22:24: error: expected ')' before 's'
   22 |     auto calc = (string s) {
      |                 ~      ^~
      |                        )
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n, m;
  
  cin >> n;
  vector<string> s(n);
  for (int i = 0; i < n; i++) {
    cin >> s(i);
  }
  
  cin >> m;
  vector<string> t(m);
  for (int i = 0; i < m; i++) {
    cin >> t(i);
  }
  
  int a = 0, b = 1;
  string str;
  
  for (int i = 0; i < n; i++, b = 1) {
    //青いカードを確かめる
    for (int j = 0; j < n; j++) {
      if (i != j && s(i) == s(j)) {
        b++;
      }
    }
    
    //赤いカードを確かめる
    for (int k = 0; k < m; k++) {
      if (s(i) == t(k)) {
        b--;
      }
    }
    
    if (b > a) {
      a = b;
    }
  }
  
  cout << a << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   10 |     cin >> s(i);
      |            ~^~~
a.cc:16:13: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   16 |     cin >> t(i);
      |            ~^~~
a.cc:25:22: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   25 |       if (i != j && s(i) == s(j)) {
      |                     ~^~~
a.cc:25:30: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   25 |       if (i != j && s(i) == s(j)) {
      |                             ~^~~
a.cc:32:12: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   32 |       if (s(i) == t(k)) {
      |           ~^~~
a.cc:32:20: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   32 |       if (s(i) == t(k)) {
      |                   ~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N,M;
  int num=0,max=0;
  
  cin >> N >> M;
  vector<string> Ns(N):
  vector<string> Ms(M);
  
  for (int i=0; i<N; i++)
    cin >> Ns.at(i);
  for (int i=0; i<M; i++)
    cin >> Ms.at(i);
  
  for (int i=0; i<N; i++){
    for (int j=i+1; j<N; j++){
      if (Ns.at(i)==Ns.at(j)) num++;
    }
    for (int k=0; k<M; k++){
      if (Ns.at(i)==Ms.at(k)) num--;
    }
    if (num>max) max=num;
    num=0;
  }
  /*
  for (int i=0; i<M; i++){
    for (int j=i+1; j<M; j++){
      if (Ms.at(i)==Ms.at(j)) num++;
    }
    for (int k=0; k<N; k++){
      if (Ms.at(i)==Ns.at(k)) num--;
    }
    if (num>max) max=num;
    num=0;
  }
  */
  cout << max << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: expected ',' or ';' before ':' token
    9 |   vector<string> Ns(N):
      |                       ^
a.cc:15:12: error: 'Ms' was not declared in this scope; did you mean 'Ns'?
   15 |     cin >> Ms.at(i);
      |            ^~
      |            Ns
a.cc:22:21: error: 'Ms' was not declared in this scope; did you mean 'Ns'?
   22 |       if (Ns.at(i)==Ms.at(k)) num--;
      |                     ^~
      |                     Ns
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N ;
  cin >> N ;
  string B[N] ;
  for ( int i=0 ; i<N ; i++ ){
    cin >> B[i] ;
  }
  int M ;
  cin >> M ;
  string R[M] ;
  for ( int i=0 ; i<M ; i++ ){
    cin >> R[M] ;
  }
  
  int ben =0;
  for ( int i= 0 ; i<N ; i++){
   if (B[i] == "A"){
     continue ;
   }else {
     for ( int j = i+1 ; j<N; j++){
       int count[i] = 1;
       if ( B[i] == B[j]) {
         count[i] ++;
         B[j] == "A";
       }
     }
     for (int j=0 ; j<M ; j++){
       if (B[i] == R[j]){
         count[i] -- ;
       }
     }
     ben = max ( ben , count[i]);
  }
  }
    cout << ben << endl;
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:23: error: array must be initialized with a brace-enclosed initializer
   24 |        int count[i] = 1;
      |                       ^
a.cc:27:15: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   27 |          B[j] == "A";
      |          ~~~~~^~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3772:5: note: declared here
 3772 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
a.cc:32:15: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   32 |          count[i] -- ;
      |               ^
a.cc:35:29: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   35 |      ben = max ( ben , count[i]);
      |                             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
    int N, M;
    cin >> N;
    vector<string> blue(N);
    for(int i = 0; i < N; i++){
        cin >> blue.at(i);
    }
    cin >> M;
    vector<string> red(M);
    for(int i = 0; i < M; i++){
        cin >> red.at(i);
    }
    int ans = 0;
    int maxans = 0;
    for(i = 0; i < N; i++){
        int bcnt = 1;
        int rcnt = 0;
        for(int j = 0; j < N; j++){
            if(i == j){
                continue;
            }
            if(blue.at(i) == blue.at(j)){
                bcnt++;
            }
        }
        for(int j = 0; j < M; j++){
            if(blue.at(i) == red.at(j)){
                rcnt--;
            }
        }
        ans = bcnt + rcnt;
        if(maxans < ans){
            maxans = ans;
        }
    }
    cout << maxans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'i' was not declared in this scope
   18 |     for(i = 0; i < N; i++){
      |         ^
Language: C++

N = int(input())
blue = []
for i in range(N):
  blue.append(input())
M = int(input())
red = []
for i in range(M):
  red.append(input())
ans = 0
for i in range(N):
  count = 0
  for j in range(N):
    if blue[j] == blue[i]:
      count += 1
  for j in range(M):
    if red[j] == blue[i]:
      count -= 1
  if count > ans:
    ans = count
print(ans)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int N ;  //NM出力
  cin >> N ;
  string b[N];
  for ( int i=0 ; i<N ; i++){
    cin >> b[i] ;
  }
   int M ;
  cin >> M ;
  string r[M];
  for ( int i=0 ; i<M ; i++){
    cin >> r[i] ;
  }
  int ben =0;
  int count[N]
    for (int i=0 ; i <N ; i++){
      count[i]=0;
    }
    for (int i=0 ; i<N ; i++)
      if (b[i] == "A"){
        continue ;
      }else if (b[i] !="A"){
        for (int j=i ; j<N ; j++){
          if (b[i]==b[j]){
            count[i]++;
              b[j] == "A";
          }
        }
        for (int j=0 ; j<M ; j++){
          if (b[i]==r[j]){
            count[i]--;
          }
        }
        if (count[i] > 0){
          ben+=count[i];
        }
      }
  cout << ben << endl;
}
        
          


Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: expected initializer before 'for'
   19 |     for (int i=0 ; i <N ; i++){
      |     ^~~
a.cc:19:20: error: 'i' was not declared in this scope
   19 |     for (int i=0 ; i <N ; i++){
      |                    ^
a.cc:28:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   28 |             count[i]++;
      |                  ^
a.cc:29:20: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   29 |               b[j] == "A";
      |               ~~~~~^~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3772:5: note: declared here
 3772 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
a.cc:34:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   34 |             count[i]--;
      |                  ^
a.cc:37:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   37 |         if (count[i] > 0){
      |                  ^
a.cc:38:21: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   38 |           ben+=count[i];
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int N ;  //NM出力
  cin >> N ;
  string b[N];
  for ( int i=0 ; i<N ; i++){
    cin >> b[i] ;
  }
   int M ;
  cin >> M ;
  string r[M];
  for ( int i=0 ; i<M ; i++){
    cin >> r[i] ;
  }
  int ben =0;
    for (int i=0 ; i<N ; i++)
      if (b[i] == "A"){
        continue ;
      }else if (b[i] !="A"){
        int count[i] = 0;
        for (int j=i ; j<N ; j++){
          if (b[i]==b[j]){
            count[i]++;
              b[j] == "A";
          }
        }
        for (int j=0 ; j<M ; j++){
          if (b[i]==r[j]){
            count[i]--;
          }
        }
        if (count[i] > 0){
          ben+=count[i];
        }
      }
  cout << ben << endl;
}
        
          

Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: array must be initialized with a brace-enclosed initializer
   22 |         int count[i] = 0;
      |                        ^
a.cc:26:20: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   26 |               b[j] == "A";
      |               ~~~~~^~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3772:5: note: declared here
 3772 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int N ;  //NM出力
  cin >> N ;
  string b[N];
  for ( int i=0 ; i<N ; i++){
    cin >> b[i] ;
  }
   int M ;
  cin >> M ;
  string r[M];
  for ( int i=0 ; i<M ; i++){
    cin >> r[i] ;
  }
  int ben =0;
    for (int i=0 ; i<N ; i++)
      if (b[i] == "A"){
        continue ;
      }else if (b[i] !="A"){
        int count[i] = 0;
        for (int j=i ; j<N ; j++){
          if (b[i]==b[j]){
            count[i]++;
              b[j] == "A";
          }
        }
        for (int j=0 ; j<M ; j++){
          if (b[i]==r[j]){
            count[i]--;
          }
        }
        if (count[i] > 0){
          ben+=count[i];
        }
      }
  cout << ben << endl;]
}
        
          

Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: array must be initialized with a brace-enclosed initializer
   22 |         int count[i] = 0;
      |                        ^
a.cc:26:20: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   26 |               b[j] == "A";
      |               ~~~~~^~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3772:5: note: declared here
 3772 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
a.cc:38:23: error: expected primary-expression before ']' token
   38 |   cout << ben << endl;]
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int N ;  //NM出力
  cin >> N ;
  string b[N];
  for ( int i=0 ; i<N ; i++){
    cin >> b[i] ;
  }
   int M ;
  cin >> M ;
  string r[M];
  for ( int i=0 ; i<M ; i++){
    cin >> r[i] ;
  }
  int ben =0;
    for (int i=0 ; i<N ; i++)
      if (b[i] == "A"){
        continue ;
      }else if (b[i] !="A"){
        int count[i]=0;
        for (int j=i ; j<N ; j++){
          if (b[i]==b[j]){
            count[i]++;
              b[j]=="A";
          }
        }
        for (int j=0 ; j<M ; j++){
          if (b[i]==r[j]){
            count[i]--;
          }
        }
        if (count>0){
          ben+=count[i];
        }
      }
  cout << ben << endl;]
}
        
          

Compiler output:
a.cc: In function 'int main()':
a.cc:22:22: error: array must be initialized with a brace-enclosed initializer
   22 |         int count[i]=0;
      |                      ^
a.cc:26:19: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   26 |               b[j]=="A";
      |               ~~~~^~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3772:5: note: declared here
 3772 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
a.cc:34:18: error: ordered comparison of pointer with integer zero ('int*' and 'int')
   34 |         if (count>0){
      |             ~~~~~^~
a.cc:38:23: error: expected primary-expression before ']' token
   38 |   cout << ben << endl;]
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  cin << N << M;
  vector <string> s (N);
  vector <string> t (M);
  for(int i = 0;i < N; i++){
   	cout >> s(i) >>endl; 
  }
  for(int i = 0;i < M; i++){
   	cout >> t(i) >>endl; 
  }
  cout << "finish" << endl:
}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 'N' was not declared in this scope
    5 |   cin << N << M;
      |          ^
a.cc:5:15: error: 'M' was not declared in this scope
    5 |   cin << N << M;
      |               ^
a.cc:9:18: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
    9 |         cout >> s(i) >>endl;
      |                 ~^~~
a.cc:12:18: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   12 |         cout >> t(i) >>endl;
      |                 ~^~~
a.cc:14:27: error: expected ';' before ':' token
   14 |   cout << "finish" << endl:
      |                           ^
      |                           ;
Language: C++

#include<bits/stdc++.h>
 
using namespace std;
 
int main()
{
    int n,m;
    map<string,int>ss;
    string blue,red;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>blue;
        ss[blue]++;
    }
    cin>>m;
    for(int j=0;j<m;j++){
        cin>>red;
        ss[red]--;
    }
    int res=0;
 
    map<string,int>:: iterator itr;
    for(itr=ss.begin();itr!=ss.end();itr++){
            res=max(res,itr->second);
    }
    cout<<res;
 
    return 0;
}
#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,m;
    map<string,int>ss;
    string blue,red;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>blue;
        ss[blue]++;
    }
    cin>>m;
    for(int j=0;j<m;j++){
        cin>>red;
        ss[red]--;
    }
    int res=0;

    map<string,int>:: iterator itr;
    for(itr=ss.begin();itr!=ss.end();itr++){
            res=max(res,itr->second);
    }
    cout<<res;

    return 0;
}
提出情報

Compiler output:
a.cc:34:5: error: redefinition of 'int main()'
   34 | int main()
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main()
      |     ^~~~
a.cc:59:1: error: '\U000063d0\U000051fa\U000060c5\U00005831' does not name a type
   59 | 提出情報
      | ^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    int N,M,res;
    string str;
    res = 0;

    cin >> N >> M;

    map<string,int> B;   
    
    for(int i = 0; i < N; i++){
        cin >> str;
        B[str]++;
    }

    for(int i = 0; i < M; i++){
        cin >> str;
        B[str]--;
    }

  	map<string,int>:: iterator itr;
    for(iter = B.begin(); iter != B.end(); iter++){
        res = max(res,iter->second);
    }

    cout << res << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'iter' was not declared in this scope; did you mean 'itr'?
   24 |     for(iter = B.begin(); iter != B.end(); iter++){
      |         ^~~~
      |         itr
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  string B[n];
  for(int i=0;i<n;i++) cin >> B[i];
  int m;
  cin >> m;
  string C[m];
  for(int i=0;i<m;i++)cin >> C[i];
  int A=-;
  for(int i=0;i<n;i++){
    int sum=0;
    for(int k=i;k<n;k++){if(B[i]==B[k]) sum++;}
    for(int l=0;l<m;l++){if(B[i]==C[l]) sum--;} 
    A=max(A,sum);
  }
   cout << A <<endl;
  }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: expected primary-expression before ';' token
   13 |   int A=-;
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<string> RedCards(N);
  for(int i=0;i<N;i++) cin >> RedCards.at(i);
  
  int M;
  cin >> M;
  vector<strin> BlueCards(M);
  for(int i=0;i<M;i++) cin >> BlueCards.at(i);
  
  string s;
  int ans,temp;
  ans=0;
  for(int i=0;i<N;i++){
    temp=0;
    s=RedCards.at(i);
    
    for(int j=0;j<N;j++){
      if(RedCards.at(j)==s) temp++;
    }
    
    for(int j=0;j<M;j++){
      if(BlueCards.at(j)==s) temp--;
    }
    ans=max(ans,temp);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'strin' was not declared in this scope; did you mean 'stdin'?
   12 |   vector<strin> BlueCards(M);
      |          ^~~~~
      |          stdin
a.cc:12:15: error: template argument 1 is invalid
   12 |   vector<strin> BlueCards(M);
      |               ^
a.cc:12:15: error: template argument 2 is invalid
a.cc:13:41: error: request for member 'at' in 'BlueCards', which is of non-class type 'int'
   13 |   for(int i=0;i<M;i++) cin >> BlueCards.at(i);
      |                                         ^~
a.cc:27:20: error: request for member 'at' in 'BlueCards', which is of non-class type 'int'
   27 |       if(BlueCards.at(j)==s) temp--;
      |                    ^~
Language: Java

import java.util.Scanner;
 
public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    Map<String,Integer> blue = new HashMap<>();
    Map<String,Integer> red = new HashMap<>();
    
    int N = sc.nextInt();
    int M = sc.nextInt();
    
    for(int i = 0; i < N; i++) {
      String s = sc.next();
      if(blue.get(s) == null) {  //値が存在しない場合
        blue.put(s, 1);
      }else {                    //値がすでに存在する場合
        blue.put(s, blue.get(s)+1);
      }
    }
    
    for(int i=0;i<M;i++) {
      String s=sc.next();
      if(red.get(s) == null) {
        red.put(s, 1);
      }else {
        red.put(s, red.get(s)+1);
      }
    }
    
    int max = 0;
    for(String key : blue.keySet()) {
      int now;
      if(red.containsKey(key)) {
        now = blue.get(key) - red.get(key);
      }else {
        now = blue.get(key);
      }
      if(max < now) {
        max = now;
      }
    }
    System.out.println(max>0?max:0);
  }
}
    

Compiler output:
Main.java:6: error: cannot find symbol
    Map<String,Integer> blue = new HashMap<>();
    ^
  symbol:   class Map
  location: class Main
Main.java:6: error: cannot find symbol
    Map<String,Integer> blue = new HashMap<>();
                                   ^
  symbol:   class HashMap
  location: class Main
Main.java:7: error: cannot find symbol
    Map<String,Integer> red = new HashMap<>();
    ^
  symbol:   class Map
  location: class Main
Main.java:7: error: cannot find symbol
    Map<String,Integer> red = new HashMap<>();
                                  ^
  symbol:   class HashMap
  location: class Main
4 errors
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define pi 3.14159265359
using namespace std;
const long long INF=1e9+7;
const string alp="abcdefghijklmnopqrstuvwxyz"; //26
const string ALP="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
//const ll MOD=998244353LL;
//const ll MOD=1777777777LL;


int main() {
  ll N,M;
  map<string,ll> coin;
  cin>>N;
  rep(i,N){
    string d;
    cin>>d;
    coin[d]++;
  }
  cin>>M;
  rep(i,M){
    string d;
    cin>>d;
    coin[d]--;
  }
  ll ans=0;
  for(auto i=coin.begin();i!=coin.end();i++){
    ans=max(ans,i.second);
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:19: error: 'struct std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, long long int> >' has no member named 'second'
   35 |     ans=max(ans,i.second);
      |                   ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define pi 3.14159265359
using namespace std;
const long long INF=1e9+7;
const string alp="abcdefghijklmnopqrstuvwxyz"; //26
const string ALP="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
//const ll MOD=998244353LL;
//const ll MOD=1777777777LL;


int main() {
  ll N,M;
  map<string,ll> coin;
  cin>>N;
  string s[N];
  rep(i,N){
    cin>>s[i];
    coin.at[s[i]]++;
  }
  cin>>M;
  string t[M];
  rep(i,M){
    cin>>t[i];
    coin.at[t[i]]--;
  }
  ll ans=0;
  rep(i,N){
    ans=max(ans,coin.at[s[i]]);
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:12: error: no match for 'operator[]' (operand types are '<unresolved overloaded function type>' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   25 |     coin.at[s[i]]++;
      |            ^
a.cc:31:12: error: no match for 'operator[]' (operand types are '<unresolved overloaded function type>' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   31 |     coin.at[t[i]]--;
      |            ^
a.cc:35:24: error: no match for 'operator[]' (operand types are '<unresolved overloaded function type>' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   35 |     ans=max(ans,coin.at[s[i]]);
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
    int N, M, P=0;
    cin >> N;
  	vector<string> N_s(N);

  	for(int i=0;i<N;i++){
    	cin >> N_s.at(i);
    }
  	cin >> M;
	vector<string> M_t(M);
  	for(int i=0;i<M;i++){
    	cin >> M_t.at(i);
    }
  	for(int i=0;i<N;i++){
      	for(int j=0;j<M;j++){
        	if(M_t.at(j)==N_s(i)){
				P++;            	
            }
        }
    }
  
    cout << P << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:34: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   19 |                 if(M_t.at(j)==N_s(i)){
      |                               ~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
int main() {
  int a, b;
  cin >> a;
  vector<string> x(a);
  for (int i = 0; i < a; i++) {
    cin >> x[i];
  }
  cin >> b;
  vector<string> y(b);
  for (int i = 0; i < b; i++) {
    cin >> y[i];
  }
  int count = 0;
  vector<int> c(min(a, b));
  if (a > b) {
  for (int i = 0; i < a; i++) {
    for (int j = 0; j < a; j++) {
      if (x[i] == x[j]) {
        count++;
      }
      if (j < y.size()) {
      if (x[i] == y[j]) {
        count--;
      }
      }
      if (j == a-1) {
        c[i] = count;
        count = 0;
      }
    }
  }
  }
  else {
    for (int i = 0; i < b; i++) {
    for (int j = 0; j < b; j++) {
      if (y[i] == x[j]) {
        count++;
      }
      if (j < x.size()) {
      if (y[i] == x[j]) {
        count--;
      }
      }
      if (j == b-1) {
        c[i] = count;
        count = 0;
      }
    }
  }
  }
  sort(c.begin(), c.end());
  cout << c[min(a, b)-1] << endl;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
	int Bluecard = 0;
	int Redcard = 0;
	int Max = 0;
	int Count = 0;
	cin >> Bluecard;
	vector<string> Blueword(Bluecard);
	vector<string> Redword(Redcard);
  
	for (int Loop = 0; Loop < Bluecard; Loop++) {
    	cin >> Blueword.at(Loop);
    }
	cin >> Redcard;
	for (int Loop = 0; Loop < Redcard; Loop++) {
    	cin >> Redword.at(Loop);
    }

		for (int Loop = 0; Loop < Redcard; Loop++) {
        	Blueword.at(Loop);  	
		for (int Loop = 0; Loop < Bluecard; Loop++) {
        	Blueword.at(Loop);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:28: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; reference = std::__cxx11::basic_string<char>&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   22 |                 Blueword.at(Loop);
      |                 ~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1180:7: note: declared here
 1180 |       at(size_type __n)
      |       ^~
a.cc:24:28: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; reference = std::__cxx11::basic_string<char>&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   24 |                 Blueword.at(Loop);
      |                 ~~~~~~~~~~~^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1180:7: note: declared here
 1180 |       at(size_type __n)
      |       ^~
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:21:60: note: to match this '{'
   21 |                 for (int Loop = 0; Loop < Redcard; Loop++) {
      |                                                            ^
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int i,N,M;
  cin >> N;
  vector<string> Blue(N);
  for(i=0;i<N;++i)
    cin >> Blue.at(i);
  cin >> M;
  vector<string> Red(M);
  for(i=0;i<M;++i)
    cin >> Red.at(i);
  int money,lastmoney=0;
  while(N--){
    money = 0;
    for(i=N;i;--i)
      money += (Blue.at(i)==Blue.at(N));
    for(i=0;i<M;++i)
      money -= (Red.at(i)==Blue.at(N));
    if(money > lastmoney)
      lastmoney = money;
  }
  cout << lastmoney << endl;
  }
}


Compiler output:
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int i,N,M;
  vector<string> Blue(N),Red(M);
  cin >> N;
  for(i=0;i<N;++i)
    cin >> Blue.at(i);
  cin >> M;
  for(i=0;i<M;++i)
    cin >> Red.at(i);
  int money,lastmoney=0;
  while(N--){
    for(i=(money=0);i<M;++i)
      money += (Blue.at(N)!=Red.at(i));
    if(money > lastmoney)
      lastmoney = money;
  cout << lastmoney << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <algorithm>
#include <iostream>
#include <string>

#include <vector>
#include <cmath>
#include <limits>
#include <functional>
using namespace std;

int main()
{
    int N, M;
    char s[105][105], t[105][105];
    int ans = 0, max = 0;

    cin >> N;
    for (int i = 0; i < N; i++)
    {
        cin >> s[i];
    }

    cin >> M;
    for (int i = 0; i < M; i++)
    {
        cin >> t[i];
    }

    for (int k = 0; k < N; k++)
    {
        for (int l = 0; l < N; l++)
        {
            if (strcmp(s[k], s[l]) == 0)
            {

                ans++;
            }
        }
        for (int l = 0; l < M; l++)
        {
            if (strcmp(s[k], t[l]) == 0)
            {
                ans--;
            }
        }
        if (max < ans)
        {
            max = ans;
        }

        ans = 0;
    }

    if (max <= 0)
    {
        cout << 0 << endl;
    }
    else
    {
        cout << max << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:17: error: 'strcmp' was not declared in this scope
   33 |             if (strcmp(s[k], s[l]) == 0)
      |                 ^~~~~~
a.cc:9:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <functional>
  +++ |+#include <cstring>
    9 | using namespace std;
a.cc:41:17: error: 'strcmp' was not declared in this scope
   41 |             if (strcmp(s[k], t[l]) == 0)
      |                 ^~~~~~
a.cc:41:17: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++


#include <bits/stdc++.h>
using namespace std;

int main() {
  int n,m,c,max;
  string e;
  max = 0;
  cin >> n;
  vector<string> r(n);
  for(int i = 0; i < n; i++) {
    cin >> r.at(i);
  }
  cin >> m;
  vector<string> b(m);
  for(int i = 0; i < m; i++) {
    cin >> b.at(i);
  }
  for(int i = 0; i < n; i++) {
    c = 0;
    e = r.at(i);
    for(int j = 0; j < n; j++) {
      if(r.at(j) == e) {
        c++;
 
        

Compiler output:
a.cc: In function 'int main()':
a.cc:24:13: error: expected '}' at end of input
   24 |         c++;
      |             ^
a.cc:23:24: note: to match this '{'
   23 |       if(r.at(j) == e) {
      |                        ^
a.cc:24:13: error: expected '}' at end of input
   24 |         c++;
      |             ^
a.cc:22:32: note: to match this '{'
   22 |     for(int j = 0; j < n; j++) {
      |                                ^
a.cc:24:13: error: expected '}' at end of input
   24 |         c++;
      |             ^
a.cc:19:30: note: to match this '{'
   19 |   for(int i = 0; i < n; i++) {
      |                              ^
a.cc:24:13: error: expected '}' at end of input
   24 |         c++;
      |             ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n,m,d,max;
  max = 0;
  string c;
  cin >> n;
  vector<string> a(n);
  for(int i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  cin >> m;
  vector<string> b(m)
  for(int i = 0; i < m; i++) {
    cin >> b.at(i);
  }
  for(int i = 0; i < n; i++) {
    d = 0;
    c = a.at(i);
    for(int j = 0; j < n; j++) {
      if(a.at(j) == c) {
        d++;
      }
    }
    for(int t = 0; t < m; t++) {
      if(b.at(t) == c) {
        d--;
      }
    }
    if(max < d) {
      max = d;
    }
  }
  cout << max << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: expected ',' or ';' before 'for'
   15 |   for(int i = 0; i < m; i++) {
      |   ^~~
a.cc:15:18: error: 'i' was not declared in this scope
   15 |   for(int i = 0; i < m; i++) {
      |                  ^
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M, c, max=0;
  string s;
  cin >> N;
  vector<string> blue(N);
  
  for(int i=0;i<N;i++){
    cin >> blue.at(i);
  }
  
  cin >> M;
  vector<string> red(M);
  
  for(int i=0;i<M;i++){
    cin >> red.at(j);
  }
  
  for(int i=0;i<N;i++){
    s=blue.at(i);
    c=0;
    for(int j=0;j<N;j++){
      if(blue.at(j) == s)
        c++;
    }
    for(int j=0;j<M;j++){
      if(red.at(j) == s)
        c--;
    }
    if(max < c)
      max = c;
  }
  
  cout << max << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:19: error: 'j' was not declared in this scope
   19 |     cin >> red.at(j);
      |                   ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main(){
  int N,M;
  cin >> N;
  vector<string> s(N);
  for (i=0;i<N;i++){
    cin >> s.at(i);
  }
  cin >> M;
  vector<string> t(M);
  for (i=0;i<N;i++){
    cin >> t.at(i);
  }
  int count = 0;
  for(i=0;i<N;i++){
    int tempCount = 0;
    string temp = s.at(i);
    for(j=0;j<N;j++){
      if(s.at(j) == temp) count++;
    }
    for(j=0;j<M;j++){
      if(t.at(j) == temp) count--;
    }
    if(count < tempCount) count = tempCount;
  }
  cout << count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 'i' was not declared in this scope
    9 |   for (i=0;i<N;i++){
      |        ^
a.cc:14:8: error: 'i' was not declared in this scope
   14 |   for (i=0;i<N;i++){
      |        ^
a.cc:18:7: error: 'i' was not declared in this scope
   18 |   for(i=0;i<N;i++){
      |       ^
a.cc:21:9: error: 'j' was not declared in this scope
   21 |     for(j=0;j<N;j++){
      |         ^
a.cc:24:9: error: 'j' was not declared in this scope
   24 |     for(j=0;j<M;j++){
      |         ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int N,M;
  cin >> N;
  vector<string> s(N);
  for (i=0;i<N;i++){
    cin >> s.at(i);
  }
  cin >> M;
  vector<string> t(M);
  for (i=0;i<N;i++){
    cin >> t.at(i);
  }
  int count = 0;
  for(i=0;i<N;i++){
    int tempCount = 0;
    string temp = s.at(i);
    for(j=0;j<N;j++){
      if(s.at(j) == temp) count++;
    }
    for(j=0;j<M;j++){
      if(t.at(j) == temp) count--;
    }
    if(count < tempCount) count = tempCount;
  }
  cout << count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<string> s(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:16: error: expected primary-expression before '>' token
    7 |   vector<string> s(N);
      |                ^
a.cc:7:18: error: 's' was not declared in this scope
    7 |   vector<string> s(N);
      |                  ^
a.cc:8:8: error: 'i' was not declared in this scope
    8 |   for (i=0;i<N;i++){
      |        ^
a.cc:12:16: error: expected primary-expression before '>' token
   12 |   vector<string> t(M);
      |                ^
a.cc:12:18: error: 't' was not declared in this scope
   12 |   vector<string> t(M);
      |                  ^
a.cc:13:8: error: 'i' was not declared in this scope
   13 |   for (i=0;i<N;i++){
      |        ^
a.cc:17:7: error: 'i' was not declared in this scope
   17 |   for(i=0;i<N;i++){
      |       ^
a.cc:20:9: error: 'j' was not declared in this scope
   20 |     for(j=0;j<N;j++){
      |         ^
a.cc:23:9: error: 'j' was not declared in this scope
   23 |     for(j=0;j<M;j++){
      |         ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main(){
  int N;
  cin >> N;
  vector<string> s(N);
  for(int i=0; i<N; i++)  cin >> s[i];

  int M;
  cin >> M;
  vector<string> t(M);
  for(int i=0; i<M; i++)  cin >> t[i];
  
  sort(s.begin(), s.end());
  sort(t.begin(), t.end());
 
  int ans = 0;
  int k = 0;
  for(int i=0; i<N; i++){
    string ss = s[i];
    int count = 1;
    for(int j=i+1; j<N; j++){
      if(ss == s[j]){
      	 count++;
     	 int i = j;
      }//if
    }//for
    for(int j=k; j<M; j++){
      if(ss == t[j]){
      	count--;
      	int k = j;
      }//if
    }//for
  ans = max(ans, count);
  }//for

  cout << ans << "\n";
}//main


Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |   sort(s.begin(), s.end());
      |   ^~~~
      |   short
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;cin>>n;
  vector<string >blue(n);
  for(int i=0;i<n;i++)cin>>blue[i];
  int m;cin>>m;
  vector<string >red(n);
  for(int i=0;i<m;i++)cin>>red[i];
  int maxi=0;
  for(int i=0;i<n;i++){
  	string s = blue[i];
    int curr=0;
    for(int i=0;i<n;i++)if(blue[i]==s)curr++;
    for(int i=0;i<m;i++)if(red[i]==s)cur--;
    maxi = max(maxi,curr);
  }
  cout<<maxi;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:38: error: 'cur' was not declared in this scope; did you mean 'curr'?
   15 |     for(int i=0;i<m;i++)if(red[i]==s)cur--;
      |                                      ^~~
      |                                      curr
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<string> vecs(N);
  string s;
  for (int i = 0; i < N; i++) {
    cin >> s;
    vecs.at(i) = s;
  }
  
  int M;
  cin >> M;
  vector<string> vect(M);
  string t;
  for (int j = 0; j < M; j++) {
    cin >> t;
    vect.at(j) = t;
  }
  
  vector<int> vec(101);
  
  for (int i = 0; i < N; i++) {
    int counts = 0;
    int countt = 0;
    for (int j = i + 1; j < N; j++) {
      if (vecs.at(i) == vecs.at(j)) 
        counts++;
      }
    for (int k = 0; k < M; k++) {
      if (vecs.at(i) == vect.at(k))
        countt++;
      }
    if (counts > countt) {
      int c;
      c = counts - countt;
      vec.push_back(counts - countt);
    }
  }
  int Ans = 0;
  for (int i = 0; i < 101; i++) {
    if (vec(i+1) > vec(i))
      Ans = vec(i+1);
  }
  if (Ans > 0)
    cout << Ans << endl;
  else if (Ans <= 0)
    cout << 0 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:12: error: no match for call to '(std::vector<int>) (int)'
   44 |     if (vec(i+1) > vec(i))
      |         ~~~^~~~~
a.cc:44:23: error: no match for call to '(std::vector<int>) (int&)'
   44 |     if (vec(i+1) > vec(i))
      |                    ~~~^~~
a.cc:45:16: error: no match for call to '(std::vector<int>) (int)'
   45 |       Ans = vec(i+1);
      |             ~~~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<string> vecs(N);
  string s;
  for (int i = 0; i < N; i++) {
    cin >> s;
    vecs.at(i) = s;
  }
  
  int M;
  cin >> M;
  vector<string> vect(M);
  string t;
  for (int j = 0; j < M; j++) {
    cin >> t;
    vect.at(j) = t;
  }
  
  vector<int> vec(101);
  
  for (int i = 0; i < N; i++) {
    int counts = 0;
    int countt = 0;
    for (int j = i + 1; j < N; j++) {
      if (vecs.at(i) == vecs.at(j)) 
        counts++;
      }
    for (int k = 0; k < M; j++) {
      if (vecs.at(i) == vect.at(k))
        countt++;
      }
    if (counts > countt) {
      int c;
      c = counts - countt;
      vec.push_back(counts - countt);
    }
  }
  int Ans = 0;
  for (i = 0; i < 101; i++) {
    if (vec(i+1) > vec(i))
      Ans = vec(i+1);
  }
  if (Ans > 0)
    cout << Ans << endl;
  else if (Ans <= 0)
    cout << 0 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:28: error: 'j' was not declared in this scope
   32 |     for (int k = 0; k < M; j++) {
      |                            ^
a.cc:43:8: error: 'i' was not declared in this scope
   43 |   for (i = 0; i < 101; i++) {
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<string> vecs(N);
  string s;
  for (int i = 0; i < N; i++) {
    cin >> s;
    vecs.at(i) = s;
  }
  
  int M;
  cin >> M;
  vector<string> vect(M);
  string t;
  for (int j = 0; j < M; j++) {
    cin >> t;
    vect.at(j) = t;
  }
  
  vector<int> vec(101)
  
  for (int i = 0; i < N; i++) {
    int counts = 0;
    int countt = 0;
    for (int j = i + 1; j < N; j++) {
      if (vecs.at(i) == vecs.at(j)) 
        counts++;
      }
    for (int k = 0; k < M; j++) {
      if (vecs.at(i) == vect.at(k))
        countt++;
      }
    if (counts > countt) {
      int c;
      c = counts - countt;
      vec.push_back(counts - countt);
    }
  }
  int Ans = 0;
  for (i = 0; i < 101; i++) {
    if (vec(i+1) > vec(i))
      Ans = vec(i+1);
  }
  if (Ans > 0)
    cout << Ans << endl;
  else if (Ans <= 0)
    cout << 0 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:3: error: expected ',' or ';' before 'for'
   25 |   for (int i = 0; i < N; i++) {
      |   ^~~
a.cc:25:19: error: 'i' was not declared in this scope
   25 |   for (int i = 0; i < N; i++) {
      |                   ^