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

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
  int n,m;
  cin >> n;
  vector<string> s,t;
  for(int i=0; i<n; i++){
    cin>>s[i];
  }
  cin>>m;
  for(int j=0; j<m; j++){
    cin>>t[j];
  }
  sort(s.begin(),s.end());
  sort(t.begin(),t.end());
  
  vector<int> sn(n),tn(m);
  fill(sn.begin(),sn.end(),1);
  fill(tn.begin(),tn.end(),-1);
  
  for(int i=0; i<n-1; i++){
    if(s[i]==s[i+1]){
      s.erase(s.begin()+i);
      sn.erase(sn.begin()+i);
      sn[i]++;
      n--;
    }
  }
  for(int i=0;i<m-1;i++){
    if(t[i]==t[i+1]){
      t.erase(t.begin()+i);
      tn.erase(tn.begin()+i);
      tn[i]--;
      m--;
    }
  }

  int ans[n+m+1];
  fill(ans,ans+n+m+1,0);
  int ite=1;
  for(int i=0,j=0;i<n;i++){
    if(s[i]==t[j]){
      ans[ite++]=sn[i]+tn[j++];
    }else if(s[i]<t[j]){
      ans[ite++]=sn[i];
    }else{
      ans[ite++]=tn[j++];
      i--;
    }
  }

  cout<<ans[max_element(ans,ans+n+m+1)]<<endl;
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:55:12: error: invalid types 'int [((n + m) + 1)][int*]' for array subscript
   55 |   cout<<ans[max_element(ans,ans+n+m+1)]<<endl;
      |            ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
  int n,m;
  cin >> n;
  vector<string> s,t;
  for(int i=0; i<n; i++){
    cin>>s[i];
  }
  cin>>m;
  for(int j=0; j<m; j++){
    cin>>t[j];
  }
  sort(s.begin(),s.end());
  sort(t.begin(),t.end());
  
  vector<int> sn(n),tn(m);
  fill(sn.begin(),sn.end(),1);
  fill(tn.begin(),tn.end(),-1);
  
  for(int i=0; i<n-1; i++){
    if(s[i]==s[i+1]){
      s.erase(s.begin()+i);
      sn.erase(sn.begin()+i);
      sn[i]++;
      n--;
    }
  }
  for(int i=0;i<m-1;i++){
    if(t[i]==t[i+1]){
      t.erase(t.begin()+i);
      tn.erase(tn.begin()+i);
      tn[i]--;
      m--;
    }
  }

  int ans[n+m+1];
  fill(ans,ans+n+m+1,0);
  int ite=1;
  for(int i=0,j=0;i<n;i++){
    if(s[i]==t[j]){
      ans[ite++]=sn[i]+tn[j++];
    }else if(s[i]<t[j]){
      ans[ite++]=sn[i];
    }else{
      ans[ite++]=tn[j++];
      i--;
    }
  }

  cout<<max(ans)<<endl;
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:55:12: error: no matching function for call to 'max(int [((n + m) + 1)])'
   55 |   cout<<max(ans)<<endl;
      |         ~~~^~~~~
In file included from /usr/include/c++/14/string:51,
                 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/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
a.cc:55:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'int*'
   55 |   cout<<max(ans)<<endl;
      |         ~~~^~~~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include <vector>
#include <string>
#include <iostream>
using namespace std;
int main() {
 
	int N, M;
	vector<string> S, T;
	cin >> N;
	for (int i = 0; i < N; i++) {
		string tmp;
		cin >> tmp;
		S.push_back(tmp);
	}
	cin >> M;
	for (int i = 0; i < M; i++) {
		string tmp;
		cin >> tmp;
		T.push_back(tmp);
	}
	int max_prize = 0;
	for (auto itr = S.begin(); itr != S.end(); itr++) {
		int blue_c = count(S.begin(), S.end(), *itr);
		int red_c = count(T.begin(), T.end(), *itr);
		int diff = blue_c - red_c;
		if (max_prize < diff) max_prize = diff;
	}
	cout << max_prize << endl;
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:30: error: 'count' was not declared in this scope
   23 |                 int blue_c = count(S.begin(), S.end(), *itr);
      |                              ^~~~~
Language: C++

#include <vector>
#include <string>
#include <iostream>
using namespace std;
int main() {

	int N, M;
	vector<string> S, T;
	cin >> N;
	for (int i = 0; i < N; i++) {
		string tmp;
		cin >> tmp;
		S.push_back(tmp);
	}
	cin >> M;
	for (int i = 0; i < M; i++) {
		string tmp;
		cin >> tmp;
		T.push_back(tmp);
	}
	int max_prize = 0;
	for (auto itr = S.begin(); itr != S.end(); itr++) {
		int blue_c = std::count(S.begin(), S.end(), *itr);
		int red_c = std::count(T.begin(), T.end(), *itr);
		int diff = blue_c - red_c;
		if (max_prize < diff) max_prize = diff;
	}
	cout << max_prize << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:35: error: 'count' is not a member of 'std'; did you mean 'cout'?
   23 |                 int blue_c = std::count(S.begin(), S.end(), *itr);
      |                                   ^~~~~
      |                                   cout
a.cc:24:34: error: 'count' is not a member of 'std'; did you mean 'cout'?
   24 |                 int red_c = std::count(T.begin(), T.end(), *itr);
      |                                  ^~~~~
      |                                  cout
Language: C

#include<stdio.h>
#include<string.h>

int main(){
  cnar s[101][11],t[101][11];
  int i,j,m,n,max=0,cnt=0;
  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%s",s[i]);
  scanf("%d",&m);
  for(i=0;i<m;i++)
    scanf("%s",t[i]);
  for(i=0;i<n;i++){
    cnt=0;
    for(j=0;j<n;j++){
      if(strcmp(s[i],s[j])==0)
        cnt++;
    }
    for(j=0;j<m;j++){
      if(strcmp(s[i],t[j])==0)
        cnt--;
    }
    if(max<cnt)
      max=cnt;
  }
  printf("%d\n",max);
}

Compiler output:
main.c: In function 'main':
main.c:5:3: error: unknown type name 'cnar'; did you mean 'char'?
    5 |   cnar s[101][11],t[101][11];
      |   ^~~~
      |   char
main.c:16:18: error: passing argument 1 of 'strcmp' from incompatible pointer type [-Wincompatible-pointer-types]
   16 |       if(strcmp(s[i],s[j])==0)
      |                 ~^~~
      |                  |
      |                  int *
In file included from main.c:2:
/usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int *'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
main.c:16:23: error: passing argument 2 of 'strcmp' from incompatible pointer type [-Wincompatible-pointer-types]
   16 |       if(strcmp(s[i],s[j])==0)
      |                      ~^~~
      |                       |
      |                       int *
/usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'int *'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
main.c:20:18: error: passing argument 1 of 'strcmp' from incompatible pointer type [-Wincompatible-pointer-types]
   20 |       if(strcmp(s[i],t[j])==0)
      |                 ~^~~
      |                  |
      |                  int *
/usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int *'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
main.c:20:23: error: passing argument 2 of 'strcmp' from incompatible pointer type [-Wincompatible-pointer-types]
   20 |       if(strcmp(s[i],t[j])==0)
      |                      ~^~~
      |                       |
      |                       int *
/usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'int *'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
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.at(i);
    }
    cin >> m;
    vector<string> t(m);
    for (int i = 0; i < m; i++){
        cin >> t.at(i);
    }
    int ans = 0;
    for (int i = 0; i < n;i++){
        int buf = 0;
        for (string a:s){
            if(a==s.at(i))buf++;
        }
        for(string b:t){
            if(b==t.at(i)) buf--;
        }
        if(ans<buf)ans = buf;
    }
    cout << buf << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:13: error: 'buf' was not declared in this scope
   27 |     cout << buf << endl;
      |             ^~~
Language: C++

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#define FOR(i,n,a) for(int i = a;i<n;i++)
#define rep(i,n) FOR(i,n,0)
#define UNFOR(i,n,a) for(int i = a;i>n;i--)
#define unrep(i,n) UNFOR(i,0.n)
typedef long long ll;
using namespace std;
int main(){
	map<string, int> s, t;
	int n m;
	cin >> n;
	vector<string> v;
	rep(i, n) {
		string tmp;
		cin >> tmp;
		v.push_back(tmp);
		if(s[tmp]==0)s[tmp]= 1;
		else s[tmp]++;
	}
	cin >> m;
	rep(i, m) {
		string tmp;
		cin >> tmp;
		v.push_back(tmp);
		if (t[tmp] == 0)t[tmp] = 1;
		else t[tmp]++;
	}
	int ans = 0;
	rep(i, v.size()) {
		max(ans, s[v[i]] - t[v[i]]);
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:15: error: expected initializer before 'm'
   41 |         int n m;
      |               ^
a.cc:42:16: error: 'n' was not declared in this scope
   42 |         cin >> n;
      |                ^
a.cc:51:16: error: 'm' was not declared in this scope
   51 |         cin >> m;
      |                ^
a.cc:61:20: warning: ignoring return value of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int]', declared with attribute 'nodiscard' [-Wunused-result]
   61 |                 max(ans, s[v[i]] - t[v[i]]);
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: declared here
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

map<string,int> word;
string s;
int n,m;
int mv;

int main(){
    
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>s;
        if(word.count(s)==0){
            word.insert(make_pair(s,0));
        }
         word(s)++;
    }
    
    cin>>m;
    for(int i=0;i<m;i++){
        cin>>s;
        if(word.count(s)==0){
            word.insert(make_pair(s,0));
        }
         word(s)--;
    }
    
    map<string,int>::iterator ite;
    
    for(ite=word.begin(); ite!=word.end();ite++){
        if(ite->second>mv){
            mv=ite->second;
        }
    }
    
    if(mv<0){
        cout<<'0'<<endl;
    }else{
    cout<<mv<<endl;
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: no match for call to '(std::map<std::__cxx11::basic_string<char>, int>) (std::string&)'
   18 |          word(s)++;
      |          ~~~~^~~
a.cc:27:14: error: no match for call to '(std::map<std::__cxx11::basic_string<char>, int>) (std::string&)'
   27 |          word(s)--;
      |          ~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define LL long long
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
#define segment_size 65536
int main(){
    int N,M;
    map<string,int> X;
    cin >> N;
    for(int i=0; i<N; i++){
        string s;
        cin >> s;
        X[s]++;
    }
    cin >> M;
    for(int i=0; i<M; i++){
        string t;
        cin >> t;
        X[t]--;
    }
    int ans = 0;
    auto itr = X.begin();
    while(itr != X.end()){
        ans = max(ans, *itr.second);
    }
    cout << ans << endl;
    
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define LL long long
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
#define segment_size 65536
int main(){
    int N,M;
    map<string,int> X;
    cin >> N;
    for(int i=0; i<N; i++){
        string s;
        cin >> s;
        X[s]++;
    }
    cin >> M;
    for(int i=0; i<M; i++){
        string t;
        cin >> t;
        X[t]--;
    }
    int ans = 0;
    auto itr = X.begin();
    while(itr != X.end()){
        ans = max(ans, *itr);
    }
    cout << ans << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:18: error: no matching function for call to 'max(int&, std::pair<const std::__cxx11::basic_string<char>, int>&)'
   29 |         ans = max(ans, *itr);
      |               ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:29:18: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::pair<const std::__cxx11::basic_string<char>, int>')
   29 |         ans = max(ans, *itr);
      |               ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:29:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   29 |         ans = max(ans, *itr);
      |               ~~~^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define LL long long
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
#define segment_size 65536
int main(){
    int N,M;
    map<string,int> X;
    cin >> N;
    for(int i=0; i<N; i++){
        string s;
        cin >> s;
        map[s]++;
    }
    cin >> M;
    for(int i=0; i<M; i++){
        string t;
        cin >> t;
        map[t]--;
    }
    int ans = 0;
    auto itr = map.begin();
    while(itr != map.end()){
        ans = max(ans, *itr);
    }
    cout << ans << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: conflicting declaration 'auto s'
   18 |         map[s]++;
      |             ^
a.cc:16:16: note: previous declaration as 'std::string s'
   16 |         string s;
      |                ^
a.cc:18:15: error: expected initializer before '++' token
   18 |         map[s]++;
      |               ^~
a.cc:24:13: error: conflicting declaration 'auto t'
   24 |         map[t]--;
      |             ^
a.cc:22:16: note: previous declaration as 'std::string t'
   22 |         string t;
      |                ^
a.cc:24:15: error: expected initializer before '--' token
   24 |         map[t]--;
      |               ^~
a.cc:27:19: error: missing template arguments before '.' token
   27 |     auto itr = map.begin();
      |                   ^
a.cc:28:21: error: missing template arguments before '.' token
   28 |     while(itr != map.end()){
      |                     ^
Language: C++

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

int main(){
	int n,m;
  	cin >> n;
  	vector<string> s(n);
  	for (i=0;i<n ;i++) cin >> s[i];
  	cin >> m;
  	vector<string> t(m);
  	for (i=0;i<m ;i++) cin >> t[i];
  	vector<int> k(n,1);
  	for (i=0;i<n ;i++){
      	for (j=i+1;j<n;j++){
  		if (s[i]==s[j]) k[i]++;
        }
      	for (j=0;j<m;j++){
  		if (s[i]==t[j]) k[i]--;
        }
    }
  	for (i=0;i<n ;i++){
      	if (k[i]>=k[i+1]) k[i+1]=k[i];
    }
  	if (k[n-1]>0) cout << k[n-1] << endl;
  	else cout << 0 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: 'i' was not declared in this scope
    8 |         for (i=0;i<n ;i++) cin >> s[i];
      |              ^
a.cc:11:14: error: 'i' was not declared in this scope
   11 |         for (i=0;i<m ;i++) cin >> t[i];
      |              ^
a.cc:13:14: error: 'i' was not declared in this scope
   13 |         for (i=0;i<n ;i++){
      |              ^
a.cc:14:14: error: 'j' was not declared in this scope
   14 |         for (j=i+1;j<n;j++){
      |              ^
a.cc:17:14: error: 'j' was not declared in this scope
   17 |         for (j=0;j<m;j++){
      |              ^
a.cc:21:14: error: 'i' was not declared in this scope
   21 |         for (i=0;i<n ;i++){
      |              ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,s,e) for (int i=s;i<(e);i++)
#define All(v) (v).begin(),(v).end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define int long long
using namespace std;
typedef long long llint;
typedef pair<int, int> P;
const int MOD = (int)1e9 + 7;
const int INF = (int)1e18 * 5;

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N, M;
    cin >> N;
    multiset<string> s, t;
    set<string> ls;
    REP(i, N){
        string st;
        cin >> st;
        s.insert(st);
        ls.insert(st);
    }
    cin >> M;
    REP(i, N){
        string st;
        cin >> st;
        t.insert(st);
        ls.insert(st);
    }
    int ans = 0;
    for(auto x: ls){
        chmax((unsigned int)ans, (int)s.count(x)-t.count(x));
    }
    cout << ans << "\n";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:15: error: lvalue required as left operand of assignment
   39 |         chmax((unsigned int)ans, (int)s.count(x)-t.count(x));
      |               ^~~~~~~~~~~~~~~~~
a.cc:7:21: note: in definition of macro 'chmax'
    7 | #define chmax(x, y) x = max(x, y)
      |                     ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <map>
 
using namespace std;
 
int main (void) {
  int N ,M;
  string s;
  map<string, int> blue;
  map<string, int> red;
  string key[N], key2[M];
  cin >> N;
  for (int i=0; i<=N-1; i++) {
     cin >> s;
     key[i]=s;
     blue[s] = int (blue[s]) +1;
     s= ' ';
  }
  cin >> M;
  for (int i=0; i<=M-1; i++) {
     cin >> s;
     key2[i]=s;
     red[s] = int (red[s]) +1;
     s =' ';
  }
  int ans =0;
  int NM =max(n,m);
  for (int i=0; i<=NM-1; i++) {
    ans=max(ans, blue[key[i]]-red[key[i]] );
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:15: error: 'n' was not declared in this scope
   31 |   int NM =max(n,m);
      |               ^
a.cc:31:17: error: 'm' was not declared in this scope
   31 |   int NM =max(n,m);
      |                 ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <map>

using namespace std;

int main (void) {
  int N ,M;
  string s;
  map<string, int> blue;
  map<string, int> red;
  string key[N];
  cin >> N;
  for (int i=0; i<=N-1; i++) {
     cin >> s;
     key[i]=s;
     blue[s] = int (blue[s]) +1;
     string ='';
  }
  cin >> M;
  for (int i=0; i<=M-1; i++) {
     cin >> s;
     red[s] = int (red[s]) +1;
     string ='';
  }
  int ans =0;
  for (int i=0; i<=N-1; i++) {
    ans=max(ans, (bule[key[i]]-red[key[i]]));
  }
  cout << ans;
}

Compiler output:
a.cc:21:14: error: empty character constant
   21 |      string ='';
      |              ^~
a.cc:27:14: error: empty character constant
   27 |      string ='';
      |              ^~
a.cc: In function 'int main()':
a.cc:21:13: error: expected unqualified-id before '=' token
   21 |      string ='';
      |             ^
a.cc:27:13: error: expected unqualified-id before '=' token
   27 |      string ='';
      |             ^
a.cc:31:19: error: 'bule' was not declared in this scope; did you mean 'blue'?
   31 |     ans=max(ans, (bule[key[i]]-red[key[i]]));
      |                   ^~~~
      |                   blue
Language: C++

#include<stdio.h>
#include<string.h>

int main(void)
{
   int n,m,i,j,x=0,c=0;
   char s[100][11],t[100][11];

   scanf("%d",&n);
   for(i=0;i<n;i++){
      scanf("%s",&s[i]);
   }
   scanf("%d",&m);
   for(i=0;i<m;i++){
      scanf("%s",&t[i]);
   }

   for(i=0;i<n;i++){
      c=1;
      for(j=i+1;j<n;j++){
         if(strcmp(s[i],s[j])==0)
         c++;
   }
      for(j=0;j<m;j++){
         if(strcmp(s[i],t[j])==0)
         c--;
       }
       if(x<=c)
       x=c;
    }
    }
   if(x<0) printf("0\n");
   else
   printf("%d\n",x);

   return 0;
}



Compiler output:
a.cc:32:4: error: expected unqualified-id before 'if'
   32 |    if(x<0) printf("0\n");
      |    ^~
a.cc:33:4: error: expected unqualified-id before 'else'
   33 |    else
      |    ^~~~
a.cc:36:4: error: expected unqualified-id before 'return'
   36 |    return 0;
      |    ^~~~~~
a.cc:37:1: error: expected declaration before '}' token
   37 | }
      | ^
Language: C++

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


bool isContained(map<string, int> mp, string key){
    for(map<string,int>::iterator itr = mp.begin(); itr != mp.end(); ++itr){
        if( itr->first == key ){
            return true;
        }            
    }
    return false;
}

int main(void){
    int N,M;
    int max=0;
    vector<string> N_card;
    vector<string> M_card;
    string a;
    map<string,int> mp;

    cin >> N;
    for (int i=0; i<N; i++){
        cin >> a;
        N_card.push_back(a);
    }
   cin >> M;
    for (int i=0; i<M; i++){
        cin >> a;
        N_card.push_back(a);

    for (int i=0; i < N; i++){
        if (isContained(mp,N_card[i])){
            mp[s[i]]++;
        }
        else{
            mp[s[i]] = 1;
        }
    }
    for(int i=0; i < M; i++){
        if (isContained(mp,M_card[i])){
            mp[s[i]]--;
        }
        else{
            mp[s[i]] = 0;
        }
    }
    for (itr = mp.begin(); itr!=mp.end(); itr++){
        if(itr ->second > max){
            max = itr -> second;
        }
    }
    cout << max;
   
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:16: error: 's' was not declared in this scope
   37 |             mp[s[i]]++;
      |                ^
a.cc:40:16: error: 's' was not declared in this scope
   40 |             mp[s[i]] = 1;
      |                ^
a.cc:45:16: error: 's' was not declared in this scope
   45 |             mp[s[i]]--;
      |                ^
a.cc:48:16: error: 's' was not declared in this scope
   48 |             mp[s[i]] = 0;
      |                ^
a.cc:51:10: error: 'itr' was not declared in this scope
   51 |     for (itr = mp.begin(); itr!=mp.end(); itr++){
      |          ^~~
a.cc:59:2: error: expected '}' at end of input
   59 | }
      |  ^
a.cc:17:15: note: to match this '{'
   17 | int main(void){
      |               ^
Language: C++

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1LL << 30;
int MOD = 1e9+7;
main(){
    int N;
    cin >> N;
    string st;
    map<string,int> mp;
    for(int i = 0;i < N;i++){
        string st;
        cin >> st;
        mp[st]++;        
    }
    cin >> N;
    for(int i = 0;i < N;i++){
        cin >> st;
        mp[st]--;
    }
    int ma = 0;
    for(auto p:mp){
        ma = max(ma, p.second)
    }
    cout << ma << endl;
}

Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:23:31: error: expected ';' before '}' token
   23 |         ma = max(ma, p.second)
      |                               ^
      |                               ;
   24 |     }
      |     ~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <set>
using namespace std;

int main() {
    int n,m;
    cin>>n;
    string s[101],t[101];
    int i,j;
    for(i=0;i<n;++i) cin>>s[i];
    cin>>m;
    for(i=0;i<m;++i) cin>>t[i];
    
    int num[101]={0};
    for(i=0;i<n;++i){
        for(j=0;j<n;++j){
            if(s[i]==s[j]){
                ++num[i];
            }
            
        }
        for(j=0;j<m;++j){
            if(s[i]==t[j]){
                --num[i];
            }
        }
            

Compiler output:
a.cc: In function 'int main()':
a.cc:28:10: error: expected '}' at end of input
   28 |         }
      |          ^
a.cc:17:21: note: to match this '{'
   17 |     for(i=0;i<n;++i){
      |                     ^
a.cc:28:10: error: expected '}' at end of input
   28 |         }
      |          ^
a.cc:7:12: note: to match this '{'
    7 | int main() {
      |            ^
Language: C

#include <math.h>
#include<stdio.h>
#include<windows.h>
#include<string.h>
void maxs(int *a,int *b)
{
	int temp;
	temp = *a;
	*a = *b;
	*b = temp;
}
typedef struct
{
	char name[50];
	int i;
}card;
int main()
{
	card a[100], index;
	int i, m, n, o,j=0;
	for (i = 0; i < 100; i++)
	{
		memset(a[i].name, 0, sizeof(a[i].name));
		a[i].i = 0;
	}
	memset(index.name, 0, sizeof(index.name));
	scanf("%d", &m);
	for (i = 0; i < m; i++)
	{
		int flag = 0;
		scanf("%s", index.name);
		if (!j)
		{
			strcpy(a[j].name, index.name);
			a[j].i++;
			j++;
		}
		else
		{
			for (o = j-1; o >= 0;o--)
				if (strcmp(a[o].name,index.name)==0)
				{
					flag = 1;
					break;
				}
			if (flag == 1)
				a[++o].i++;
			else
			{
				strcpy(index.name,a[j].name);
				a[j++].i++;
			}
		}
		memset(index.name, 0, sizeof(index.name));
	}
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		int flag = 0;
		scanf("%s", index.name);
		if (!j)
		{
			strcpy(a[j].name, index.name);
			a[j].i++;
			j++;
		}
		else
		{
			for (o = j; o >= 0; o--)
				if (strcmp(index.name, a[o].name)==0)
				{
					flag = 1;
					break;
				}
			if (flag == 1)
				a[++o].i--;
			else
			{
				strcpy(a[o].name, index.name);
				a[j++].i--;
			}
		}
		memset(index.name, 0, sizeof(index.name));
	}
	index.i = a[0].i;
	for (i = 1; i < j-1; i++)
		if (a[i].i > index.i)
			index.i = a[i].i;
	printf("%d", index.i);
	system("pause");
	return 0;
}

Compiler output:
main.c:3:9: fatal error: windows.h: No such file or directory
    3 | #include<windows.h>
      |         ^~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s[] = new String[n+1];
        s[0] = "a";
        for(int i=1;i<=n;i++){
            s[i] = sc.next();
        }
        int m = sc.nextInt();
        String t[] = new String[m+1];
        t[0] = "a";
        for(int i=1;i<=m;i++){
            t[i] = sc.next();
        }
        int a[] = new int[n+1];
        int b[] = new int[n+1];
        int c[] = new int[n+1];
        for(int i=0;i<=n;i++){
            a[i] = 0;
            b[i] = 0;
            c[i] = 0;
        }
        int max = 0;
        for(int i=1;i<=n;i++){
            for(int j=1;j<=n;j++){
                if(s[j].equals(s[i])){
                    a[i] += 1;
                }
            }
            for(int k=1;k<=m;k++){
                if(t[k].equals(s[i])){
                    b[i] += 1;
                }
            }
            c[i] = a[i] - b[i];
            if(c[i]>max){
                max = c[i];
            }
        }
        System.out.println(max);
    }

Compiler output:
Main.java:43: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#include<iostream>
using namespace std;
map<string,int>h;
int i,n;
string s;
int main()
{
scanf("%d",%n);
    for(i=0;i<n;i++）
{
        cin>>s;
            if(!h[s]++)
                printf("OK\n");
            else
                cout<<s<<h[s]-1<<end1;
}
}

Compiler output:
a.cc:3:1: error: 'map' does not name a type
    3 | map<string,int>h;
      | ^~~
a.cc: In function 'int main()':
a.cc:8:12: error: expected primary-expression before '%' token
    8 | scanf("%d",%n);
      |            ^
a.cc:9:20: error: expected ')' before '\U0000ff09'
    9 |     for(i=0;i<n;i++）
      |        ~           ^~
      |                    )
a.cc:9:20: error: '\U0000ff09' was not declared in this scope
    9 |     for(i=0;i<n;i++）
      |                    ^~
Language: C++

#include<iosteram>
#include<string>
#include<algorithm>
using namespace std:

int main(){
	int n, m;
	cin >> n;
	string s[n];
	for(int i=0;i<n;i++)cin>>s[i];
	cin>>m;
	string t[m];
	for(int i=0;i<m;i++)cin>>t[i];
	int ans=0;
	for(int i=0;i<n;i++){
		int sum = 1;
		for (int j = i + 1;j < n;j++) {
			if (s[i] == s[j])sum++;
		}
		for (int j = 0;j < m;j++) {
			if (s[i] == t[j])sum--;
		}
		ans = max(ans, sum);
	}
	cout << ans << endl;
}

Compiler output:
a.cc:1:9: fatal error: iosteram: No such file or directory
    1 | #include<iosteram>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iosteram>
#include<string>
#include<algorithm>
using namespace std:

int main(){
	int n, m;
	cin >> n;
	string s[n];
	for(int i=0;i<n;i++)cin>>s[i];
	cin>>m;
	string t[m];
	for(int i=0;i<m;i++)cin>>t[i];
	int ans=0;
	for(int i=0;i<n;i++){
		int sum = 1;
		for(int j=i+1;j<n;j++)if(s[i]==s[j])sum++;
		for(int j=0;j<m;j++)if(s[i]==t[j])sum--;
		ans=max(ans,sum);
	}
	cout << ans << endl;
}

Compiler output:
a.cc:1:9: fatal error: iosteram: No such file or directory
    1 | #include<iosteram>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iosteram>
#include<string>
#include<algorithm>
using namespace std:

int main(){
	int n,m;
	string s[100],t[100];
	cin>>n;
	for(int i=0;i<n;i++)cin>>s[i];
	cin>>m;
	for(int i=0;i<m;i++)cin>>t[i];
	int ans=0;
	for(int i=0;i<n;;i++){
		int sum = 1;
		for(int j=i+1;j<n;j++)if(s[i]==s[j])sum++;
		for(int j=0;j<m;j++)if(s[i]==t[j])sum--;
		ans=max(ans,sum);
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc:1:9: fatal error: iosteram: No such file or directory
    1 | #include<iosteram>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iosteram>
#include<string>
using namespace std:

int main(){
	int n,m;
	string s[100],t[100];
	cin>>n;
	for(int i=0;i<n;i++)cin>>s[i];
	cin>>m;
	for(int i=0;i<m;i++)cin>>t[i];
	int ans=0;
	for(int i=0;i<n;;i++){
		int sum = 1;
		for(int j=i+1;j<n;j++)if(s[i]==s[j])sum++;
		for(int j=0;j<m;j++)if(s[i]==t[j])sum--;
		ans=max(ans,sum);
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc:1:9: fatal error: iosteram: No such file or directory
    1 | #include<iosteram>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
using namespace std;
int n,m;
int main(){
        cin >> n;
        string s[n];
        for(int i=0; i<n; i++) {
                cin >> s[i];
        }
        cin >> m;
        string t[m];
        for(int i=0; i<m; i++) {
                cin >> t[i];
        }
        for(int i=0; i<n; i++) {
                int sum=1;
                for(int j=i+1; j<n; j++) {
                        if(s[i]==s[j]) sum++;
                }
                for(int j=0; j<m; j++) {
                        if(s[i]==t[j]) sum--;
                }
                ans=max(ans,sum);
        }
        cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |                 ans=max(ans,sum);
      |                 ^~~
      |                 abs
a.cc:26:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: Java

import java.util.*;
public class Main3 {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		HashMap<String, Integer> map = new HashMap<String, Integer>();
		int bc = sc.nextInt();
		for (int i = 0; i < bc; i++) {
			String line = sc.next();
			if (map.containsKey(line)) {
				map.put(line, map.get(line) + 1);
			} else {
				map.put(line, 1);
			}
		}
		
		int rc = sc.nextInt();
		for (int i = 0; i < rc; i++) {
			String line = sc.next();
			if (map.containsKey(line)) {
				map.put(line, map.get(line) - 1);
			} else {
				map.put(line, -1);
			}
		}
		
		int max = 0;
		for (String key : map.keySet()) {
			if (map.get(key) > max) {
				max = map.get(key);
			}
		}
		
		System.out.println(max);
	}
}

Compiler output:
Main.java:2: error: class Main3 is public, should be declared in a file named Main3.java
public class Main3 {
       ^
1 error
Language: C++

#include <iostream>
#include <string>
#inlcude <map>
#include <cmath>
#include <set>

using namespace std;

int main() {
  int n, m;
  cin >> n;
  map<string, int> mp;
  set<string> st;
  string s;
  int MAX = 0;
  for (int i = 0; i < n; i++) {
    cin >> s;
    mp[s]++;
    st.insert(s);
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> s;
    mp[s]--;
    st.insert(s);
  }
  for (set<string>::iterator ite = st.begin(); ite != st.end(); ite++) {
    MAX = max(MAX, mp[*(ite)]);
  }
  cout << MAX << endl;
}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    3 | #inlcude <map>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:12:3: error: 'map' was not declared in this scope
   12 |   map<string, int> mp;
      |   ^~~
a.cc:6:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    5 | #include <set>
  +++ |+#include <map>
    6 | 
a.cc:12:13: error: expected primary-expression before ',' token
   12 |   map<string, int> mp;
      |             ^
a.cc:12:15: error: expected primary-expression before 'int'
   12 |   map<string, int> mp;
      |               ^~~
a.cc:18:5: error: 'mp' was not declared in this scope; did you mean 'm'?
   18 |     mp[s]++;
      |     ^~
      |     m
a.cc:24:5: error: 'mp' was not declared in this scope; did you mean 'm'?
   24 |     mp[s]--;
      |     ^~
      |     m
a.cc:28:20: error: 'mp' was not declared in this scope; did you mean 'm'?
   28 |     MAX = max(MAX, mp[*(ite)]);
      |                    ^~
      |                    m
Language: C++

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

int main()
{
  vector<int> point_count;
  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];
  }

  string temp;
  for (int i = 0; i < N; i++) {
    int count = 0;
    temp = s[i];
    for (int j = 0; j < N; j++) {
      if (temp == s[j]) {
        count++;
      }
    }
    for (int j = 0; j < M; j++) {
      if (temp == t[j]) {
        count--;
      }
    }
    point_count.push_back(count);
  }

  // for (auto x: point_count) {
  //   cout << x << endl;
  // }

  int max = *max_element(point_count.begin(), point_count.end());
  if (max >= 0) cout << max << endl;
  else cout << 0 << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:14: error: 'max_element' was not declared in this scope
   43 |   int max = *max_element(point_count.begin(), point_count.end());
      |              ^~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main()
{
	int n;
	cin>>n;
	string blue[n];
	
	for (int i=0;i<n;i++) {
        cin >> blue[i];
    }
    
    int n;
	cin>>n;
	string red[m];
	
	for (int i=0;i<m; i++) {
        cin >> red[i];
    }
    
    int ans = 0;
    for (int i=0; i<n; i++)
	{
		string word=blue[i];   //"apple", "orange"
		int count=0;
		
		for(int j=0;j<n;j++){
			if (blue[j]==word) count++;
		}
		
		for (int j=0; j<m; j++){
			if (red[j]==word) count--;
		}
		
		ans = max(ans, count);
	}
	
	cout << ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: redeclaration of 'int n'
   14 |     int n;
      |         ^
a.cc:6:13: note: 'int n' previously declared here
    6 |         int n;
      |             ^
a.cc:16:20: error: 'm' was not declared in this scope
   16 |         string red[m];
      |                    ^
a.cc:19:16: error: 'red' was not declared in this scope; did you mean 'read'?
   19 |         cin >> red[i];
      |                ^~~
      |                read
a.cc:33:29: error: 'red' was not declared in this scope; did you mean 'read'?
   33 |                         if (red[j]==word) count--;
      |                             ^~~
      |                             read
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
    int n;
    cin>>n;
    string blue[n];
	for(int i=0;i<n;i++){
        cin>>blue[i];
    }
	int m;
    cin>>m;
    string red[m];
	for(int i=0;i<m;i++){
        cin>>red[i];
    }
    int ans=0;
    for(int i=0;i<n;i++)
	{
		string word=blue[i];   
		int count=0;
		for (int j=0;j<n;j++){
			if(blue[j]==word) count++;
		}
		for(int j=0;j<m;j++){
			if(red[j]==word) count--;
		}
		ans=max(ans,count);
	}
	
	cout<<ans;
	return 0;
}#include <iostream>
#include <string>
using namespace std;
int main(){
    int n;
    cin>>n;
    string blue[n];
	for(int i=0;i<n;i++){
        cin>>blue[i];
    }
	int m;
    cin>>m;
    string red[m];
	for(int i=0;i<m;i++){
        cin>>red[i];
    }
    int ans=0;
    for(int i=0;i<n;i++)
	{
		string word=blue[i];   
		int count=0;
		for (int j=0;j<n;j++){
			if(blue[j]==word) count++;
		}
		for(int j=0;j<m;j++){
			if(red[j]==word) count--;
		}
		ans=max(ans,count);
	}
	
	cout<<ans;
	return 0;
}

Compiler output:
a.cc:33:2: error: stray '#' in program
   33 | }#include <iostream>
      |  ^
a.cc:33:3: error: 'include' does not name a type
   33 | }#include <iostream>
      |   ^~~~~~~
a.cc:36:5: error: redefinition of 'int main()'
   36 | int main(){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(){
      |     ^~~~
Language: C++

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

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

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

    int ans = 0;
    for (int i=0; i<n; i++)
	{
		string word=blue[i];   
		int count=0;
		
		for (int j=0; j<n; j++){
			if (blue[j]==word) count++;
		}
		
		for (int j=0; j<m; j++){
			if (red[j]==word) count--;
		}
		
		ans = max(ans, count);
	}
	
	cout << ans;
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vvi vector<vi>
#define vs vector<string>
#define pb push_back
#define P pair<int,int>
#define vp vector<P>
#define PP pair<int,P>
#define vpp vector<PP>
#define fi first
#define se second
#define INF 1e9
#define MOD 1000000007
#define REP(i,n) for(int i=0;i<n;i++)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define all(x) (x).begin(),(x).end()
int main(){
    int n,m;
    cin>>n;
    map<string,int> a;
    REP(i,n){
        string st;
        cin>>st;
        a[st]++;
    }
    cin>>m;
    map<string,int> b;
    REP(i,m){
        string st;
        cin>>st;
        b[st]++;
    }
    int ans=0;
    for(auto itr:a){
        ans=max(a,max(0,itr.se-b[itr.fi]));
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:16: error: no matching function for call to 'max(std::map<std::__cxx11::basic_string<char>, int>&, const int&)'
   37 |         ans=max(a,max(0,itr.se-b[itr.fi]));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:37:16: note:   deduced conflicting types for parameter 'const _Tp' ('std::map<std::__cxx11::basic_string<char>, int>' and 'int')
   37 |         ans=max(a,max(0,itr.se-b[itr.fi]));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:37:16: note:   'std::map<std::__cxx11::basic_string<char>, int>' is not derived from 'std::initializer_list<_Tp>'
   37 |         ans=max(a,max(0,itr.se-b[itr.fi]));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

>#include<iostream>
>#include<string>
>using namespace std;
>int main(){
>	string a[100],b[100];
>	int n,m,ans,bns=0;
>	cin>>n;
>	for(int i=0;i<n;i++){
>		cin>>a[i];
>	}
>	cin>>m;
>	for(int j=0;j<n;j++){
>		cin>>b[j];
>	}
>	
>	for(int i=0;i<n;i++){
>		for(int j=0;j<n;j++){
>		ans=0;
>		if(a[i]==b[j]){
>			ans++;
>		}
>		
>		else ans--;
>		
>	}
>}
>	
>	bns=max(bns,ans);
>	cout<<bns<<endl;
>	
>}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | >#include<iostream>
      |  ^
a.cc:2:2: error: stray '#' in program
    2 | >#include<string>
      |  ^
a.cc:1:1: error: expected unqualified-id before '>' token
    1 | >#include<iostream>
      | ^
a.cc:4:1: error: expected unqualified-id before '>' token
    4 | >int main(){
      | ^
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:33:5: error: expected ',' or ';' before 'for'
   33 |     for (string t: blue){
      |     ^~~
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 lambda function:
a.cc:25:15: error: no match for 'operator-' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   25 |         if (t=-s) buf++;
      |               ^~
In file included from /usr/include/c++/14/string:48,
                 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/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   candidate expects 2 arguments, 1 provided
a.cc: In function 'int main()':
a.cc:33:5: error: expected ',' or ';' before 'for'
   33 |     for (string t: blue){
      |     ^~~