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

#include<stdio.h>
#include<string>
#include<iostream>
#include<math.h>
#include<vector>
#include<set>
#include<algorithm>
#include<list>
#include<map>
#include<set>
using namespace std;

int main() {
	int N, M, x = 0,l=0;
	string  s;
	cin >> N;
	map<string, int>S, T, num;
	set<string>s1, t1;
	for (int i = 0;i < N;i++) {
		cin >> s;
		s1.insert(s);
		S[s]++;
	}


	cin >> M;
	for (int i = 0;i < M;i++) {
		cin >> s;
		t1.insert(s);
		T[s]++;
	}

	

	for (auto itr1 : s1) {
		for (auto itr2 : t1) {
			if (itr1 == itr2) {
				num[itr1] = S[itr1] - T[itr2];
			}
			else l++;
		}
		if (l == t1.size()) {
			num[itr1] = S[itr1];
			l++
		}
	}


	for (auto itr : s1) {
		if (num[itr] >= x)x = num[itr];
	}

	cout << x << endl;

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:28: error: expected ';' before '}' token
   44 |                         l++
      |                            ^
      |                            ;
   45 |                 }
      |                 ~
Language: C

// ConsoleApplication17.cpp: 定义控制台应用程序的入口点。
//

#include <stdio.h>
#include<cstdio>
int string(char a[], char b[])
{
	int i =0;

	while (a[i] !='\0')
	{
		if (a[i] != b[i])
			return 0;
		i++;
	}
	if (b[i] != '\0')
		return 0;
	return 1;
}

int main()
{
	int B, R;
	int i, j;
	char b[100][10],r[100][10];
	int m,n;
	int fea=0;

	scanf("%d",&B);
	getchar();
	for (i = 0; i < B; i++)
	{
		gets(b[i]);
		//getchar();
		//scanf_s("%s", b[i]);
	}

	scanf("%d", &R);
	getchar();
	for (i = 0; i < R; i++)
	{
		gets(r[i]);
		//scanf_s("%s", r[i]);
	}

	for (i = 0; i < B; i++)
	{
		m = 0;
		n = 0;
		for (j = 0; j < B; j++)
		{
			if (string(b[i], b[j]))
			{
				m++;
				//b[j][0]='X';
				//b[j][1] ='Y';
			}
		}
		for (j = 0; j < R; j++)
		{
			if (string(b[i], r[j]))
			{
				n++;
			}
		}
		if(m-n>fea)
		fea = m - n;
	}
     printf("%d",fea);

    return 0;
}



Compiler output:
main.c:5:9: fatal error: cstdio: No such file or directory
    5 | #include<cstdio>
      |         ^~~~~~~~
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();
int M = sc.nextInt();
String[] s = new String[N];
String[] t = new String[M];
for(int i = 0;i < N;i++){
s[i] = sc.next();
}
for(int i = 0;i < M;i++){
t[i] = sc.next();
}
int[] score = new int[N];
Arrays.fill(score, 0);
for(int i = 0;i < N;i++){
 for(int j = 0;j < N;j++){
 if(s[i].equals(s[j])){score[i] = score[i] + 1;}
 }
}
for(int i = 0;i < N;i++){
 for(int j = 0;j < M;j++){
 if(s[i].equals(t[j])){score[i] score[i] - 1;}
 }
}
Arrays.sort(score);
System.out.println(score(N-1));
}
}

Compiler output:
Main.java:24: error: not a statement
 if(s[i].equals(t[j])){score[i] score[i] - 1;}
                            ^
Main.java:24: error: ';' expected
 if(s[i].equals(t[j])){score[i] score[i] - 1;}
                               ^
Main.java:24: error: not a statement
 if(s[i].equals(t[j])){score[i] score[i] - 1;}
                                         ^
3 errors
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <string>
#include <utility>
#include <map>
using namespace std;
#define rep(i,n) for(int i=1;i<=(int)(n);i++)
#define Rep(i,n) for(int i=0;i<=(int)(n-1);i++)
typedef long long ll;
int dx[]={-1,0,1,0};
int dy[]={0,-1,0,1};


int N,M;
string s[110],t[110];
int p[110];


int main() {
	cin>>N;
	Rep(i,N) cin>>s[i];
	cin>>M;
	Rep(i,M) cin>>t[i];
	Rep(i,N){
		int p[i]=0;
		Rep(j,N){
			if(i>j && s[i]==s[j]) break;
			else if(s[i]==s[j]) p[i]++;
		}
		Rep(j,M){
			if(s[i]==t[j]) p[i]--;
		}
		if(p[i]<=0) p[i]=0;
	}
	sort(p,p+110);
	reverse(p,p+110);
	cout<<p[0]<<endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:26: error: array must be initialized with a brace-enclosed initializer
   28 |                 int p[i]=0;
      |                          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b;
  map<string,int>m;
  cin>>a;
  while(a--){
   string s;
    cin>>s;
    m[s]++;
  }
  cin>>b;
  while(b--){
   string s;
    cin>>s;
    m[s]--;
  }
  map<string,int>::iterator it=m.begin();
  for(;it!=m.end();it++){
    ans=max(ans,(*it).second);
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |     ans=max(ans,(*it).second);
      |     ^~~
      |     abs
a.cc:22:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   22 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-13;
const double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
double ABS(double a){return max(a,-a);}
char str[110];
string A[110];
string B[110];
int main(){
	int a,b;scanf("%d",&a);
	for(int i=0;i<a;i++){
		scanf("%s",str);A[i]=str;
	}
	scanf("%d",&b);
	for(int i=0;i<b;i++){
		scanf("%s",str);B[i]=str;
	}
	int ret=0;
	for(int i=0;i<a;i++){
		int tmp=0;
		for(int j=0;j<a;j++){
			if(a[i]==a[j])tmp++;
		}
		for(int j=0;j<b;j++){
			if(a[i]==b[j])tmp--;
		}
		ret=max(ret,tmp);
	}
	printf("%d\n",ret);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:29: error: invalid types 'int[int]' for array subscript
   42 |                         if(a[i]==a[j])tmp++;
      |                             ^
a.cc:42:35: error: invalid types 'int[int]' for array subscript
   42 |                         if(a[i]==a[j])tmp++;
      |                                   ^
a.cc:45:29: error: invalid types 'int[int]' for array subscript
   45 |                         if(a[i]==b[j])tmp--;
      |                             ^
a.cc:45:35: error: invalid types 'int[int]' for array subscript
   45 |                         if(a[i]==b[j])tmp--;
      |                                   ^
Language: C++

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

int main(){
    std::map<std::string, int> score;
    int N, M;
    std::cin >> N;
    std::string *blue = new std::string[N];
    for(int i = 0; i < N; i++){
        std::cin >> blue[i];
        if(score[blue[i]] == 0){
            score[blue[i]] = 0;
        }
        score[blue[i]] += 1;
    }
    std::cin >> M;
    std::string *red = new std::string[M];
    for(int j = 0; j < M; j++){
        std::cin >> red[j];
        if(score[red[j]] == 0){
            score[red[j]] = 0;
        }
        score[red[j]] -= 1;
    }
    std::cout << *std::max_element(score.begin(), score.end()) << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:24: error: 'max_element' is not a member of 'std'; did you mean 'tuple_element'?
   26 |     std::cout << *std::max_element(score.begin(), score.end()) << std::endl;
      |                        ^~~~~~~~~~~
      |                        tuple_element
Language: C++

#include <iostream> 
#include <string> 
#include <map>
using namespace std;
 
map<string, int>mp1, mp2;
 
int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    string s;
    cin>>s;
    mp1[s]++1;
  }
  int m;
  cin>>m;
  for(int i=0; i<m; i++){
	string s ;
	cin>>s ;
	mp2[s]++ ;
   }
  	map<string, int> :: iterator it ;
	int mx = 0 ;
	for(it = mp1.begin(); it != mp1.end(); it++){
		mx = max(mx, mp1[it->first] - mp2[it->first]) ;
	}
	cout<<mx<<endl ;
	return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: expected ';' before numeric constant
   14 |     mp1[s]++1;
      |             ^
      |             ;
Language: C++

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

map<string, int>mp1, mp2;

int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    string s;
    cin>>s;
    mp1[s]+=1;
  }
  int m;
  cin>>m;
  for(int i = 0; i < n; i++){
	string s ;
	cin>>s ;
	mp2[s]+=1 ;
   }
  	map<string, int> :: iterator it ;
	int mx = 0 ;
	for(it = mp1.begin(); it != mp1.end(); it++){
		mx = max(mx, mp1[it->first] - mp2[it->first]) ;
	}
	cout<<mx<<endl ;
	return 0 ;
}

Compiler output:
a.cc:5:1: error: 'map' does not name a type
    5 | map<string, int>mp1, mp2;
      | ^~~
a.cc: In function 'int main()':
a.cc:13:5: error: 'mp1' was not declared in this scope
   13 |     mp1[s]+=1;
      |     ^~~
a.cc:20:9: error: 'mp2' was not declared in this scope
   20 |         mp2[s]+=1 ;
      |         ^~~
a.cc:22:9: error: 'map' was not declared in this scope
   22 |         map<string, int> :: iterator it ;
      |         ^~~
a.cc:2:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    1 | #include <iostream>
  +++ |+#include <map>
    2 | #include <string>
a.cc:22:19: error: expected primary-expression before ',' token
   22 |         map<string, int> :: iterator it ;
      |                   ^
a.cc:22:21: error: expected primary-expression before 'int'
   22 |         map<string, int> :: iterator it ;
      |                     ^~~
a.cc:24:13: error: 'it' was not declared in this scope; did you mean 'int'?
   24 |         for(it = mp1.begin(); it != mp1.end(); it++){
      |             ^~
      |             int
a.cc:24:18: error: 'mp1' was not declared in this scope
   24 |         for(it = mp1.begin(); it != mp1.end(); it++){
      |                  ^~~
a.cc:25:47: error: 'mp2' was not declared in this scope
   25 |                 mx = max(mx, mp1[it->first] - mp2[it->first]) ;
      |                                               ^~~
Language: C++

{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}

import Control.Applicative
import Control.Monad
import Control.Arrow
import Data.List
import Data.Maybe
import Data.Char
import qualified Data.ByteString.Char8 as B
import Text.Printf

readInt = ( readLn :: IO Int )
readInts = map ( read :: String -> Int ) . words <$> getLine

getList = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = do
	n <- readInt
	ss <- replicateM n getLine
	m <- readInt
	ts <- replicateM m getLine
	let
		count s = length . filter( == s )
		benefit s = count s ss - count s ts
	print $ max 0 $ maximum $ map benefit $ ss ++ ts


Compiler output:
a.cc:1:3: error: stray '#' in program
    1 | {-# LANGUAGE ScopedTypeVariables #-}
      |   ^
a.cc:1:34: error: stray '#' in program
    1 | {-# LANGUAGE ScopedTypeVariables #-}
      |                                  ^
a.cc:2:3: error: stray '#' in program
    2 | {-# LANGUAGE BangPatterns #-}
      |   ^
a.cc:2:27: error: stray '#' in program
    2 | {-# LANGUAGE BangPatterns #-}
      |                           ^
a.cc:1:1: error: expected unqualified-id before '{' token
    1 | {-# LANGUAGE ScopedTypeVariables #-}
      | ^
a.cc:2:1: error: expected unqualified-id before '{' token
    2 | {-# LANGUAGE BangPatterns #-}
      | ^
a.cc:4:1: error: 'import' does not name a type
    4 | import Control.Applicative
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<string>
#include<string.h>
#include<map>
#include<set>
#include<vector>
#include<stdio.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
int main()
{
string s[101];
string t[101];
int cnt[101];
int cnttt[101];
int ans=0;
int m,n;
cin>>m;
for(int i=0;i<m;i++)
cin>>s[i];
cin>>n;
for(int i=0;i<n;i++)
cin>>t[i];
for(int i=0;i<m-1;i++)
{int cntt=1;
 for(int j=i;j<m;j++)
 {
  if(s[i]==s[j])
  cntt++;}
 cnt[i]=cntt;}
for(int i=0;i<n-1;i++)
{for(int j=i;j<n;j++)
 int cntt=1;
 {
  if(t[i]==t[j])
  cntt++;}
 cnttt[i]=cntt;}
for(int i=0;i<m;i++)
{for(int j=0;j<n;j++)
 ans=max(ans,cnt[i]-cnttt[j]);}
if(ans>=0)
cout<<ans;
else
cout<<0;
system("pause");
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:14: error: 'j' was not declared in this scope
   37 |   if(t[i]==t[j])
      |              ^
a.cc:38:3: error: 'cntt' was not declared in this scope; did you mean 'cnttt'?
   38 |   cntt++;}
      |   ^~~~
      |   cnttt
a.cc:39:11: error: 'cntt' was not declared in this scope; did you mean 'cnttt'?
   39 |  cnttt[i]=cntt;}
      |           ^~~~
      |           cnttt
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  int n,m,i,j;
  string s;
  vector<string> ss;
  cin>>n;
  for(i=0;i<n;i++){
    cin>>s;
    ss.push_back(s);
  }
  cin>>m;
  for(i=0;i<m;i++){
    cin>>s;
    ss.push_back(s);
  }
  int ma=0;
  int m;
  for(i=0;i<n+m;i++){
    m=0;
    for(j=0;j<n+m;j++){
      if(ss[i]==ss[j]&&j<n){
        m++;
      }
      else if(ss[i]==ss[j]&&j>=n){
        m--;
      }
    }
    ma=max(m,ma);
  }
  cout<<ma<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:7: error: redeclaration of 'int m'
   21 |   int m;
      |       ^
a.cc:7:9: note: 'int m' previously declared here
    7 |   int n,m,i,j;
      |         ^
Language: C++

#include"bits/stdc++.h"
using namespace std;
int main()
{
    string s[111],t[111];
  	int n,m;
  	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 mx=INT_MIN;
  	for(int i=0;i<n;i++){
      int c=0;

      for(int x=0;x<n;x++)
      	if(s[i]==s[x]) c++;

      for(int y=0;y<m;y++)
        if(s[i]==t[y]) c--;

      mx=max(mx,c);
    }
  	cout<<a<<endl;
}


/**

#include <iostream>
#include <map>
using namespace std;
int N,M,mx;
string t,s[110];
map< string,int > mp;
int main(){
    cin >>N ;
    for (int i=0;i<N;++i) cin>>s[i],mp[s[i]]++;
  ///  for(int i=0;i<N;++i){
 ///       cout<<mp[s[i]]<<" ";
 ///  }

    cin >> M;
    while(M--) cin>>t,mp[t]--;
    cout<<mp[t]<<" ";
    for (int i=0;i<N;++i) mx=max(mx,mp[s[i]]);
    cout << mx ;
}

*/


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

#include"bits/stdc++.h"
using namespace std;
int main()
{
    string s[101],t[101];
  	int n,m;
  	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 mx=INT_MIN;
  	for(int i=0;i<n;i++){
      int c=0;

      for(int x=0;x<n;x++)
      	if(s[i]==s[x]) c++;

      for(int y=0;y<m;y++)
        if(s[i]==t[y]) c--;

      mx=max(mx,c);
    }
  	cout<<a<<endl;
}


/**

#include <iostream>
#include <map>
using namespace std;
int N,M,mx;
string t,s[110];
map< string,int > mp;
int main(){
    cin >>N ;
    for (int i=0;i<N;++i) cin>>s[i],mp[s[i]]++;
  ///  for(int i=0;i<N;++i){
 ///       cout<<mp[s[i]]<<" ";
 ///  }

    cin >> M;
    while(M--) cin>>t,mp[t]--;
    cout<<mp[t]<<" ";
    for (int i=0;i<N;++i) mx=max(mx,mp[s[i]]);
    cout << mx ;
}

*/


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

#include <iostream>
#include <map>
using namespace std;
int N,M,mx;
string t,s[110];
map< string,int > mp;
int main(){
    cin >>N ;
    for (int i = 0; i < N;++i) cin >> s[i], mp[s[i]]++;
    cin >> M;
    while(--M) cin >> t;mp[t]--;
    for (int i = 0;i < N;++i) mx = max(mx,mp(s[i]));
    cout << mx ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:45: error: no match for call to '(std::map<std::__cxx11::basic_string<char>, int>) (std::string&)'
   12 |     for (int i = 0;i < N;++i) mx = max(mx,mp(s[i]));
      |                                           ~~^~~~~~
Language: C++

#include <iostream>
#include <map>
using namespace std;
int N,M,mx;
string t,s[110];
map< string,int > mp;
int main(){
    cin >>N ;
    for (int i = 0; i < N;++i) cin >> s[i], mp[s[i]]++;
    cin >> M;
    while(--m) cin >> t, mp[t]--;
    for (int i = 0,i < n,++i) mx = max(mx,s[i]);
    cout << mx ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'm' was not declared in this scope
   11 |     while(--m) cin >> t, mp[t]--;
      |             ^
a.cc:12:21: error: expected ';' before '<' token
   12 |     for (int i = 0,i < n,++i) mx = max(mx,s[i]);
      |                     ^~
      |                     ;
a.cc:12:22: error: expected primary-expression before '<' token
   12 |     for (int i = 0,i < n,++i) mx = max(mx,s[i]);
      |                      ^
a.cc:12:24: error: 'n' was not declared in this scope
   12 |     for (int i = 0,i < n,++i) mx = max(mx,s[i]);
      |                        ^
a.cc:12:29: error: expected ';' before ')' token
   12 |     for (int i = 0,i < n,++i) mx = max(mx,s[i]);
      |                             ^
      |                             ;
a.cc:12:39: error: no matching function for call to 'max(int&, std::string&)'
   12 |     for (int i = 0,i < n,++i) mx = max(mx,s[i]);
      |                                    ~~~^~~~~~~~~
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:   template argument deduction/substitution failed:
a.cc:12:39: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   12 |     for (int i = 0,i < n,++i) mx = max(mx,s[i]);
      |                                    ~~~^~~~~~~~~
/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
Language: C++

#include <iostream>
#include <map>
using namespace std;
int N,M;
sting t,s[110];
map< string,int > mp;
int main(){
    cin >>N ;
    for (int i = 0; i < N;++i) cin >> s[i], mp[s[i]]++;
    cin >> M;
    while(--m) cin >> t, mp[t]--;
    for (int i = 0,i < n,++i) mx = max(mx,s[i]);
    cout << mx ;
}


Compiler output:
a.cc:5:1: error: 'sting' does not name a type
    5 | sting t,s[110];
      | ^~~~~
a.cc: In function 'int main()':
a.cc:9:39: error: 's' was not declared in this scope
    9 |     for (int i = 0; i < N;++i) cin >> s[i], mp[s[i]]++;
      |                                       ^
a.cc:11:13: error: 'm' was not declared in this scope
   11 |     while(--m) cin >> t, mp[t]--;
      |             ^
a.cc:11:23: error: 't' was not declared in this scope; did you mean 'tm'?
   11 |     while(--m) cin >> t, mp[t]--;
      |                       ^
      |                       tm
a.cc:12:21: error: expected ';' before '<' token
   12 |     for (int i = 0,i < n,++i) mx = max(mx,s[i]);
      |                     ^~
      |                     ;
a.cc:12:22: error: expected primary-expression before '<' token
   12 |     for (int i = 0,i < n,++i) mx = max(mx,s[i]);
      |                      ^
a.cc:12:24: error: 'n' was not declared in this scope
   12 |     for (int i = 0,i < n,++i) mx = max(mx,s[i]);
      |                        ^
a.cc:12:29: error: expected ';' before ')' token
   12 |     for (int i = 0,i < n,++i) mx = max(mx,s[i]);
      |                             ^
      |                             ;
a.cc:12:31: error: 'mx' was not declared in this scope; did you mean 'mp'?
   12 |     for (int i = 0,i < n,++i) mx = max(mx,s[i]);
      |                               ^~
      |                               mp
a.cc:12:43: error: 's' was not declared in this scope
   12 |     for (int i = 0,i < n,++i) mx = max(mx,s[i]);
      |                                           ^
a.cc:13:13: error: 'mx' was not declared in this scope; did you mean 'mp'?
   13 |     cout << mx ;
      |             ^~
      |             mp
Language: C

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

int main()
{
	int n,m,max=0;
	cin >> n;
	string temp,str;
	map<string,int> my;
	for(int i = 0; i < n; i++) {
		cin >> temp;
		map<string,int>::iterator it;
		it = my.begin();
		while(it != my.end())
		{
			if(it->first == temp) {
				my[temp]++;
				break;
			}
			it++;
		}
		if(it == my.end()) {
			my[temp] = 1;
		}
	}
	cin >> m;
	for(int i=0;i<m;i++)
	{
		cin>>str;
		map<string,int>::iterator it;
		it = my.begin();
		while(it!=my.end())
		{
			if(it->first == str)
			{
				my[str]--;
				break;
			}
			it++;
		}
	}
	map<string,int>::iterator it;
	it = my.begin();
	while(it!=my.end())
	{
		if(it->second>max)
			max=it->second;
        it++;
	}
	printf("%d",max);

}



Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<cstdio>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int string(char a[], char b[])
{
	int i =0;
 
	while (a[i] !='\0')
	{
		if (a[i] != b[i])
			return 0;
		i++;
	}
	return 1;
}
 
int main()
{
	int B, R;
	int i, j;
	char b[100][10],r[100][10];
	int m,n;
	int fea=0;
 
	scanf("%d",&B);
	getchar();
	for (i = 0; i < B; i++)
	{
		gets(b[i]);
		//getchar();
		//scanf("%s", b[i]);
	}
 
	scanf("%d", &R);
	getchar();
	for (i = 0; i < R; i++)
	{
		gets(r[i]);
		//scanf_s("%s", r[i]);
	}
 
	for (i = 0; i < B; i++)
	{
		m = 1;
		n = 0;
		for (j = 1; j < B; j++)
		{
			if (string(b[i], b[j]))
			{
				m++;
			}
		}
		for (j = 0; j < R; j++)
		{
			if (string(b[i], r[j]))
			{
				n++;
			}
		}
		if(m-n>fea)
		fea = m - n;
	}
     printf("%d",fea);
 
    return 0;
}

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

#include<stdio.h>
#include<string>
#include<iostream>
#include<math.h>
#include<vector>
#include<set>
#include<algorithm>
#include<list>
#include<map>
#include<set>
using namespace std;

int main() {
	int N, M, x = 0;;
	string  s;
	cin >> N;
	map<string, int>str_t, str_s;
	set<string>s1, s2;
	for (int i = 0;i < N;i++) {
		cin >> s;
		s1.insert(s);
		str_t[s]++;
	}
	cin >> M;
	for (int i = 0;i < M;i++) {
		cin >> s;
		s2.insert(s);
		str_s[s]++;
	}
	for (auto itr1 : s1) {
		for (auto itr2 : s2) {
			if (itr1== itr2) {
				if (str_t[itr1] >= str_s[itr2]) {
					if (x < str_t[itr1] - str_s[itr2]) x = str_t[itr1] - str_s[itr2];
					else x = 0;
			}
			else {
				if (x>str_t[itr1]) {
					x = str_t[itr1];
				}
			}
		}
	}
	
	cout << x << endl;

	return 0;

}

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

#include<cstdio>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int string(char a[], char b[])
{
	int i =0;

	while (a[i] !='\0')
	{
		if (a[i] != b[i])
			return 0;
		i++;
	}
	return 1;
}

int main()
{
	int B, R;
	int i, j;
	char b[100][10],r[100][10];
	int m,n;
	int fea=0;

	scanf("%d",&B);
	getchar();
	for (i = 0; i < B; i++)
	{
		gets(b[i]);
		//getchar();
		//scanf("%s", b[i]);
	}

	scanf("%d", &R);
	getchar();
	for (i = 0; i < R; i++)
	{
		gets(r[i]);
		//scanf_s("%s", r[i]);
	}

	for (i = 0; i < B; i++)
	{
		m = 1;
		n = 0;
		for (j = 1; j < B; j++)
		{
			if (string(b[i], b[j]))
			{
				m++;
			}
		}
		for (j = 0; j < R; j++)
		{
			if (string(b[i], r[j]))
			{
				n++;
			}
		}
		if(m-n>fea)
		fea = m - n;
	}
     printf("%d",fea);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   30 |                 gets(b[i]);
      |                 ^~~~
      |                 getw
a.cc:39:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   39 |                 gets(r[i]);
      |                 ^~~~
      |                 getw
Language: C++

#include <stdio.h>
#include<stdlib.h>
#include<string.h>
int string(char a[], char b[])
{
	int i =0;
 
	while (a[i] !='\0')
	{
		if (a[i] != b[i])
			return 0;
		i++;
	}
	return 1;
}
 
int main()
{
	int B, R;
	int i, j;
	char b[100][10],r[100][10];
	int m,n;
	int fea=0;
 
	scanf("%d",&B);
	getchar();
	for (i = 0; i < B; i++)
	{
		gets(b[i]);
		//getchar();
		//scanf_s("%s", b[i]);
	}
 
	scanf("%d", &R);
	getchar();
	for (i = 0; i < R; i++)
	{
		gets(r[i]);
		//scanf_s("%s", r[i]);
	}
 
	for (i = 0; i < B; i++)
	{
		m = 1;
		n = 0;
		for (j = 1; j < B; j++)
		{
			if (string(b[i], b[j]))
			{
				m++;
			}
		}
		for (j = 0; j < R; j++)
		{
			if (string(b[i], r[j]))
			{
				n++;
			}
		}
		if(m-n>fea)
		fea = m - n;
	}
     printf("%d",fea);
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   29 |                 gets(b[i]);
      |                 ^~~~
      |                 getw
a.cc:38:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   38 |                 gets(r[i]);
      |                 ^~~~
      |                 getw
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int i,n,m;
	char a[101][11];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		sc
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'sc' was not declared in this scope
   10 |                 sc
      |                 ^~
Language: C++

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

int main() {
    int N,M;

    cin >> N;


    char s[N][10];

    for(int i=0;i<N;i++){
        scanf("%s",s[i]);
        //printf("%s\n",s[i]);
    }
    cin >> M;
    char t[M][10];
    for(int i=0;i<M;i++){
        scanf("%s",t[i]);

    }
    bool flag[N];
    for(int i=0;i<N;i++){
        flag[i] = false;
    }
    int sum = 1;
    int max = 0;
    for(int i=0;i<N;i++){
        sum = 1;
        if(flag[i] ==true) continue;
        flag[i] = true;
        for(int j=i+1;j<N;j++){
            if(strcmp(s[i],s[j])==0){
                sum++;
                flag[j] = true;
            }
        }
        //printf("%s\n",s[0]);
        for(int j=0;j<M;j++){
            if(strcmp(s[i],t[j])==0){
                //printf("%d%s\n,%s\n",i,s[i],t[j]);
                sum = sum -1;
            }
        }
        if(sum > max) max = sum;
        //cout << sum <<"\n";
    }
    cout <<max << "\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:16: error: 'strcmp' was not declared in this scope
   35 |             if(strcmp(s[i],s[j])==0){
      |                ^~~~~~
a.cc:4:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <vector>
  +++ |+#include <cstring>
    4 | using namespace std;
a.cc:42:16: error: 'strcmp' was not declared in this scope
   42 |             if(strcmp(s[i],t[j])==0){
      |                ^~~~~~
a.cc:42:16: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <stdio.h>
#include<stdlib.h>
int string(char a[], char b[])
{
	int i =0;
 
	while (a[i] !='\0')
	{
		if (a[i] != b[i])
			return 0;
		i++;
	}
	return 1;
}
 
int main()
{
	int B, R;
	int i, j;
	char b[100][10],r[100][10];
	int m,n;
	int fea=0;
 
	scanf("%d",&B);
	getchar();
	for (i = 0; i < B; i++)
	{
		gets_s(b[i]);
		//getchar();
		//scanf_s("%s", b[i]);
	}
 
	scanf("%d", &R);
	getchar();
	for (i = 0; i < R; i++)
	{
		gets_s(r[i]);
		//scanf_s("%s", r[i]);
	}
 
	for (i = 0; i < B; i++)
	{
		m = 1;
		n = 0;
		for (j = 1; j < B; j++)
		{
			if (string(b[i], b[j]))
			{
				m++;
			}
		}
		for (j = 0; j < R; j++)
		{
			if (string(b[i], r[j]))
			{
				n++;
			}
		}
		if(m-n>fea)
		fea = m - n;
	}
     printf("%d",fea);
 
    return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'gets_s' was not declared in this scope
   28 |                 gets_s(b[i]);
      |                 ^~~~~~
a.cc:37:17: error: 'gets_s' was not declared in this scope
   37 |                 gets_s(r[i]);
      |                 ^~~~~~
Language: C++

#include <stdio.h>
#include<stdlib.h>
int string(char a[], char b[])
{
	int i =0;

	while (a[i] !='\0')
	{
		if (a[i] != b[i])
			return 0;
		i++;
	}
	return 1;
}

int main()
{
	int B, R;
	int i, j;
	char b[100][10],r[100][10];
	int m,n;
	int fea=0;

	scanf("%d",&B);
	getchar();
	for (i = 0; i < B; i++)
	{
		gets(b[i]);
		//getchar();
		//scanf_s("%s", b[i]);
	}

	scanf("%d", &R);
	getchar();
	for (i = 0; i < R; i++)
	{
		gets(r[i]);
		//scanf_s("%s", r[i]);
	}

	for (i = 0; i < B; i++)
	{
		m = 1;
		n = 0;
		for (j = 1; j < B; j++)
		{
			if (string(b[i], b[j]))
			{
				m++;
			}
		}
		for (j = 0; j < R; j++)
		{
			if (string(b[i], r[j]))
			{
				n++;
			}
		}
		if(m-n>fea)
		fea = m - n;
	}
     printf("%d",fea);

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   28 |                 gets(b[i]);
      |                 ^~~~
      |                 getw
a.cc:37:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   37 |                 gets(r[i]);
      |                 ^~~~
      |                 getw
Language: C++

#include <math.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
int main()
{
    int n,m;
    while(~scanf("%d",&n))
    {
        char s[205][50];
        getchar();
        for(int i=0;i<n;i++)
        {
            gets(s[i]);
        }
        scanf("%d",&m);
        getchar();
        for(int i=n;i<m+n;i++)
        {
            gets(s[i]);
        }
        int d=0;
        int shu[205];
        for(int i=0;i<205;i++)
            shu[i]=300;
        for(int i=0;i<n+m;i++)
        {
            for(int j=1;j<n+m;j++)
            {
                if(strcmp(s[i],s[j])==0&&shu[j]==300)
                    shu[i]=shu[j]=d;
            }
            d++;
        }
        int maxn=0;
        for(int i=0;i<n;i++)
        {
            int x=1;
            for(int j=1;i<n+m;j++)
            {
                if(j<n)
                {
                    if(shu[i]==shu[j])
                    {
                        x++;
                        if(maxn<x)
                            maxn=x;
                    }
                }
                if(j>=n)
                {
                    if(shu[i]==shu[j])
                    {
                        x--;
                        if(maxn<x)
                            maxn=x;
                    }
                }
            }
        }
        printf(maxn>0?"%d\n":"0\n",maxn);
    }
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'gets' was not declared in this scope; did you mean 'getw'?
   15 |             gets(s[i]);
      |             ^~~~
      |             getw
a.cc:21:13: error: 'gets' was not declared in this scope; did you mean 'getw'?
   21 |             gets(s[i]);
      |             ^~~~
      |             getw
Language: C

#include<stdio.h>
int main(void)
{
      int N,M,i,r,s[11],t[11],n,m;
      scanf ("%d",&N);
      for(i=1;i<=N;i++){
            scanf("%s",s);
      }
      scanf ("%d",&M);
      for(r=1;r<=M;r++){
            scanf("%s",t);
      }
      scount("%d",s）
      printf("%d",n-m);
      return 0;
}
int scount(void);
{
      
      return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:7: error: implicit declaration of function 'scount' [-Wimplicit-function-declaration]
   13 |       scount("%d",s）
      |       ^~~~~~
main.c:13:19: error: 's\U0000ff09' undeclared (first use in this function)
   13 |       scount("%d",s）
      |                   ^~~
main.c:13:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:22: error: expected ')' before 'printf'
   13 |       scount("%d",s）
      |             ~        ^
      |                      )
   14 |       printf("%d",n-m);
      |       ~~~~~~          
main.c:15:16: error: expected ';' before '}' token
   15 |       return 0;
      |                ^
      |                ;
   16 | }
      | ~               
main.c: At top level:
main.c:18:1: error: expected identifier or '(' before '{' token
   18 | {
      | ^
Language: C++

#include <iostream>
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 max = 0;

    for(int i = 0; i < N; ++i) {
        int count_plus = 0;
        int count_minus = 0;

        for(int j = 0 ; j < N; ++j) {
            if(s[i] == s[j]) {
                count_plus += 1;
            }
            if(s[i] == t[j]) {
                count_minus -= 1;
            }
            
        }

        if(count_plus + count_minus > max) {
            max = count_plus + count_minus;
        }
    }


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

#include<stdio.h>
int main()
{
    int i, max=0,n,m,j,x,k,flag;
    char s[101][11], t[101][11],a[11];
    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        scanf("%*c%s", a);
        for (j = 0; j < 10; j++)
            s[i][j] = a[j];
        for(j=0;j<10;j++)
            a[j]='\0'
    }
    scanf("%d", &m);
    for (i = 0; i < m; i++) {
        scanf("%*c%s", a);
        for (j = 0; j < 10; j++)
            t[i][j] = a[j];
        for (j = 0; j<10; j++)
            a[j] = '\0'
    }
    for (i = 0; i < n; i++)
    {
        x = 0;
        for (j = 0; j < n; j++)
        {
            flag = 1;
            for (k = 0; k < 10; k++) {
                if (s[i][k] != s[j][k])
                    flag = 0;
            }
            if(flag==1)
                x++;
        }
        for (j = 0; j < m; j++)
        {
            flag = 1;
            for (k = 0; k < 10; k++) {
                if (s[i][k] != t[j][k])
                    flag = 0;
            }
            if (flag == 1)
                x--;
        }
        if (x > max)
            max = x;
    }
    printf("%d", max);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: expected ';' before '}' token
   12 |             a[j]='\0'
      |                      ^
      |                      ;
   13 |     }
      |     ~                 
a.cc:20:24: error: expected ';' before '}' token
   20 |             a[j] = '\0'
      |                        ^
      |                        ;
   21 |     }
      |     ~
Language: C++

#include <iostream>
#include <vector>
#include <string>
 
using namespace std;
 
int main(void){
  int N,M;
  string tmp;
  
  cin >> N;
 
  vector<string> si;
  for(int i = 0; i < N; i++){
    cin >> tmp;
    si.push_back(tmp);
  }
 
  cin >> M;
 
  vector<string> ti;
  for(int i = 0; i < M; i++){
    cin >> tmp;
    ti.push_back(tmp);
  }
  
  //全ての青いカードを調べて、青いカードにある分・赤いカードにある分をたしかめる
  int max = -99999999;
  int score;
  for(int i = 0; i < N; i++){
    score = 0;
    for(int j = 0; j < N; j++){
      if( si[i] == si[j] ){
        score++;
      }
 
    }
    for(int j = 0; j < N; j++){
      if( j >= M )break;
      if( si[i] == ti[j] )
        score--;
    }
    
    if( max < score )max = score;
  }
 
  if( max < 0 ) max = 0;
  
  cout << max << endl;
  
  return 0;
}
#include <iostream>
#include <vector>
#include <string>
 
using namespace std;
 
int main(void){
  int N,M;
  string tmp;
  
  cin >> N;
 
  vector<string> si;
  for(int i = 0; i < N; i++){
    cin >> tmp;
    si.push_back(tmp);
  }
 
  cin >> M;
 
  vector<string> ti;
  for(int i = 0; i < M; i++){
    cin >> tmp;
    ti.push_back(tmp);
  }
  
  //全ての青いカードを調べて、青いカードにある分・赤いカードにある分をたしかめる
  int max = -99999999;
  int score;
  for(int i = 0; i < N; i++){
    score = 0;
    for(int j = 0; j < N; j++){
      if( si[i] == si[j] ){
        score++;
      }

    }
    for(int j = 0; j < N; j++){
      if( j >= M )break;
      if( si[i] == ti[j] )
        score--;
    }
    
    if( max < score )max = score;
  }

  if( max < 0 ) max = 0;
  
  cout << max << endl;
  
  return 0;
}

Compiler output:
a.cc:59:5: error: redefinition of 'int main()'
   59 | int main(void){
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main(void){
      |     ^~~~
Language: C

#include<stdio.h>
int main(void)
{
      int N,M,i,r,s[11],t;[11]
      scanf("%d",&N)
      for(i=1;i<=N;i++){
            scanf("%s",s)
      }
      scanf("%d",&M)
      for(r=1;r<=M;r++){
            scanf("%s",t)
      }
      printf("1")
      return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:27: error: expected expression before '[' token
    4 |       int N,M,i,r,s[11],t;[11]
      |                           ^
Language: C++

#include <iostream>
#include <string>

// #define DEBUG_SHOW(x) cout<<(#x)<<" = "<<(x)<<endl

using namespace std;
inline int max(int a, int b);
int main(){
	int n;
	string s[110];
	int m;
	string t[110];
	cin >> n;
  	DEBUG_SHOW(n);
	for(int i = 0; i < n; i++){
		cin >> s[i];
	  	DEBUG_SHOW(s[i]);
	}
	cin >> m;
  	DEBUG_SHOW(n);
	for(int i = 0; i < m; i++){
		cin >> t[i];
	  	DEBUG_SHOW(t[i]);
	}
	
	int ans = 0;
	for(int j = 0; j < n; j++){
		string tmp_s = s[j];
		int tmpAns = 0;
		for(int i = 0; i < n; i++){
			// 青いカードはプラス
			if(tmp_s == s[i]) tmpAns++;
		}
		for(int i = 0; i < m; i++){
			// 赤いカードはマイナス
			if(tmp_s == t[i]) tmpAns--;
		}
		ans = max(ans, tmpAns - 1);
	}
	cout << ans << endl;
	return 0;
}
inline int max(int a, int b){
	return a < b? a: b;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'DEBUG_SHOW' was not declared in this scope
   14 |         DEBUG_SHOW(n);
      |         ^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#include <string.h>
using namespace std;
int main()
{
    int n,m;
    int i,j;
    scanf("%d",&n);
    getchar();
    char s[n][100];
    for(i=0;i<n;i++)
    {
        gets(s[i]);
    }
    scanf("%d",&m);
    getchar();
    char t[m][100];
    for(i=0;i<m;i++)
    {
        gets(t[i]);
    }
    int num[n];
    for(i=0;i<n;i++)
    {
        num[i]= 0;
    }
    for(i=0; i<n; i++)
    {
        for(j=0; j<n;j++)
        {
            if(strcmp(s[i],s[j])==0)
            {
                num[i]++;
            }
        }
    }
    for(i=0; i<n; i++)
    {
        for(j=0; j<m; j++)
        {
            if(strcmp(s[i],t[j])==0)
            {
                num[i]--;
            }
        }
    }
    sort(num,num+n);
    if(num[n-1]>0)
        printf("%d\n",num[n-1]);
    else
        printf("0\n");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   13 |         gets(s[i]);
      |         ^~~~
      |         getw
a.cc:20:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   20 |         gets(t[i]);
      |         ^~~~
      |         getw
Language: C++

#include<stdio.h>
#include<math.h>
#include<string.h>
#include<algorithm>
using namespace std;
int main()
{
    char a[200][200],b[200][200];
    int n,m,i,j,k,max=0,sum1,sum2,sum,pi;
    while(scanf("%d",&n)==1)
    {
        sum1=0,sum2=0,max=0;
        getchar();
        for(i=0;i<n;i++)
        {
            gets(a[i]);
        }
        scanf("%d",&m);
        getchar();
        for(i=0;i<m;i++)
        {
            gets(b[i]);
        }
        for(i=0;i<n;i++)
        {
            sum1=0,sum2=0;
            for(j=i;j<n;j++)
            {
                pi=1;
                for(k=0;a[i][k];k++)
                {
                    if(a[i][k]!=a[j][k])
                        pi=0;
                }
                if(pi)
                    sum1++;
            }
            for(j=0;j<m;j++)
            {
                pi=1;
                for(k=0;a[i][k];k++)
                {
                    if(a[i][k]!=b[j][j])
                        pi=0;
                }
                if(pi)
                    sum2++;
            }
            sum=sum1-sum2;
            max=sum>max?sum:max;
        }
        printf("%d\n",max);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: 'gets' was not declared in this scope; did you mean 'getw'?
   16 |             gets(a[i]);
      |             ^~~~
      |             getw
a.cc:22:13: error: 'gets' was not declared in this scope; did you mean 'getw'?
   22 |             gets(b[i]);
      |             ^~~~
      |             getw
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    char a[100][20],bb[20];
	int n,m,i,j,maxx=0;
	map<int,int> mm;
    scanf("%d%d",&n,&m);
    for(i=0;i<n;i++)
    {
		scanf("%s",a[i]);
		mm[(int)a[i][0]]++;
	}
	for(i=0;i<n;i++)
	{
		scanf("%s",bb);
		mm[(int)bb[0]]--;
	}
	for(i=0;i<n;i++)
	{
		maxx=max(maxx,mm.count((int)a[i][0]));
	}
	printf("%d",maxx);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:25: error: no matching function for call to 'max(int&, std::map<int, int>::size_type)'
   21 |                 maxx=max(maxx,mm.count((int)a[i][0]));
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:21:25: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::map<int, int>::size_type' {aka 'long unsigned int'})
   21 |                 maxx=max(maxx,mm.count((int)a[i][0]));
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:21:25: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   21 |                 maxx=max(maxx,mm.count((int)a[i][0]));
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: Java

import java.util.*;
import java.util.stream.Collectors;

import static java.lang.System.out;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Map<String,Integer> map = new HashMap<>();
        long n = sc.nextLong();
        for (int i = 0; i < n ; i++) {
            String s = sc.next();
            Integer score = map.getOrDefault(s, 0);
            score += 1;
            map.put(s,score);
        }
        long m = sc.nextLong();
        for (int i = 0; i < m ; i++) {
            String s = sc.next();
            Integer score = map.getOrDefault(s, 0);
            score -= 1;
            map.put(s,score);
        }

        int max = map.values().stream().max(Comparator.naturalOrder()).get();


        if(max < 0){
            out.print(0);
        }else{
            out.print(max);
        }
    }


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

#include<stdio.h>
#include<math.h>
#include<string.h>
#include<algorithm>
using namespace std;
int main()
{
    char a[105][20],b[105][20];
    int n,m,i,j,k,max=0,sum1,sum2,sum,pi;
    while(scanf("%d",&n)==1)
    {
        sum1=0,sum2=0,max=0;
        getchar();
        for(i=0;i<n;i++)
        {
            gets(a[i]);
        }
        scanf("%d",&m);
        getchar();
        for(i=0;i<m;i++)
        {
            gets(b[i]);
        }
        for(i=0;i<n;i++)
        {
            sum1=0,sum2=0;
            for(j=i;j<n;j++)
            {
                pi=1;
                for(k=0;a[i][k];k++)
                {
                    if(a[i][k]!=a[j][k])
                        pi=0;
                }
                if(pi)
                    sum1++;
            }
            for(j=0;j<m;j++)
            {
                pi=1;
                for(k=0;a[i][k];k++)
                {
                    if(a[i][k]!=b[j][j])
                        pi=0;
                }
                if(pi)
                    sum2++;
            }
            sum=sum1-sum2;
            max=sum>max?sum:max;
        }
        printf("%d\n",max);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: 'gets' was not declared in this scope; did you mean 'getw'?
   16 |             gets(a[i]);
      |             ^~~~
      |             getw
a.cc:22:13: error: 'gets' was not declared in this scope; did you mean 'getw'?
   22 |             gets(b[i]);
      |             ^~~~
      |             getw
Language: C++

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

int main (){
    int N, M, i, j, cnt[]={1};
    string s[], t[100];
    
    cin >> N;
    for(i = 0; i < N; i++)
        cin >> s[i];
    
    cin >> M;
    for(i = 0; i < M; i++)
        cin >> t[i];
        
    for(i = 0; i < N; i++){
        for(j = 0; j < M; j++){
            if(s[i] == t[j])
                cnt[i]++;
            else
                cnt[i]--;
        }
    }

    for(i = 0; i < (N <= M ? (M-1) : (N-1)); i++){
        if(cnt[0] <= cnt[i+1])
            cnt[0] = cnt[i+1];
    }
        
    cout << cnt[0] << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: array size missing in 's'
    7 |     string s[], t[100];
      |            ^