criyle/codenet-compile-errors huggingface dataset:
Language: Java

public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int n = parseInt(sc.next());
		HashMap<String, Integer> s = new HashMap<>();
		String str;
		Integer cnt;
		for (i = 0; i < n; i++) {
			str = sc.next();
			if((cnt = s.get(str)) == null) {
				s.put(str, 1);
			} else {
				s.put(str, cnt+1);
			}
		}
		int m = parseInt(sc.next());
		for (i = 0; i < m; i++) {
			str = sc.next();
			if((cnt = s.get(str)) == null) {
				s.put(str, -1);
			} else {
				s.put(str, cnt-1);
			}
		}
		sc.close();
		ArrayList<Integer> list = new ArrayList<>(s.values());
		Collections.sort(list, Comparator.reverseOrder());
		out.println(list.get(0)<0?0:list.get(0));
	}
}


Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(in);
		                 ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(in);
		                         ^
  symbol:   variable in
  location: class Main
Main.java:6: error: cannot find symbol
		HashMap<String, Integer> s = new HashMap<>();
		^
  symbol:   class HashMap
  location: class Main
Main.java:6: error: cannot find symbol
		HashMap<String, Integer> s = new HashMap<>();
		                                 ^
  symbol:   class HashMap
  location: class Main
Main.java:27: error: cannot find symbol
		ArrayList<Integer> list = new ArrayList<>(s.values());
		^
  symbol:   class ArrayList
  location: class Main
Main.java:27: error: cannot find symbol
		ArrayList<Integer> list = new ArrayList<>(s.values());
		                              ^
  symbol:   class ArrayList
  location: class Main
Main.java:28: error: cannot find symbol
		Collections.sort(list, Comparator.reverseOrder());
		^
  symbol:   variable Collections
  location: class Main
Main.java:28: error: cannot find symbol
		Collections.sort(list, Comparator.reverseOrder());
		                       ^
  symbol:   variable Comparator
  location: class Main
Main.java:29: error: cannot find symbol
		out.println(list.get(0)<0?0:list.get(0));
		^
  symbol:   variable out
  location: class Main
10 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;

int main() {
    int N, M;
    vector<string> S, T;
    cin >> N;
    for (int i = 0; i < N; i++){
        string s;
        cin >> s;
        S.push_back(s);
    }

    cin >> M;
    for (int i = 0; i < M; i++){
        string t;
        cin >> t;
        T.push_back(t);
    }

    sort(S.begin(), S.end())
    sort(T.begin(), T.end())

    int i = 0;
    int j = 0;
    int ans = 0;

    while (i <= N) {
        int tmp = 1;
        while (S[i] == S[i + 1]){
            tmp++;
            i++;
        }
        while (j <= M) {
            if (T[j] == S[i]){
                tmp--;
            }
            j++;
        }
        ans = max(ans,ans+tmp);
        i++;
        j = 0;
    }
    cout << ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:29: error: expected ';' before 'sort'
   24 |     sort(S.begin(), S.end())
      |                             ^
      |                             ;
   25 |     sort(T.begin(), T.end())
      |     ~~~~                     
a.cc:31:12: error: 'i' was not declared in this scope
   31 |     while (i <= N) {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;

int main() {
    int N, M;
    vector<string> S, T;
    cin >> N;
    for (int i = 0; i < N; i++){
        string s;
        cin >> s;
        S.push_back(s);
    }

    cin >> M;
    for (int i = 0; i < M; i++){
        string t;
        cin >> t;
        T.push_back(t);
    }

    sort(S.begin(), S.end())
    sort(T.begin(), T.end())

    int i = 0;
    int j = 0;
    int ans = 0;

    while (i <= N) {
        int tmp = 1;
        while (S[i] == S[i + 1]){
            tmp++;
            i++;
        }
        while (j <= M) {
            if (T[j] == S[i]){
                tmp--;
            }
            j++;
        }
        ans = max(ans,ans+tmp);
        i++;
        j = 0
    }
    cout << ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:29: error: expected ';' before 'sort'
   24 |     sort(S.begin(), S.end())
      |                             ^
      |                             ;
   25 |     sort(T.begin(), T.end())
      |     ~~~~                     
a.cc:31:12: error: 'i' was not declared in this scope
   31 |     while (i <= N) {
      |            ^
a.cc:45:14: error: expected ';' before '}' token
   45 |         j = 0
      |              ^
      |              ;
   46 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;

int main() {
    int N, M;
    vector<string> S, T;
    cin >> N;
    for (int i = 0; i < N; i++){
        string s;
        cin >> s;
        S.push_back(s);
    }

    cin >> M;
    for (int i = 0; i < M; i++){
        string t;
        cin >> t;
        T.push_back(t);
    }

    sort(S.begin(), S.end())
    sort(T.begin(), T.end())

    int i = 0;
    int j = 0;
    int ans = 0;

    while (i <= N) {
        int tmp = 1;
        while (S[i] == S[i + 1]){
            tmp++;
            i++;
        }
        while (j <= M && T[j] == S[i]) {
            tmp--;
            j++;
        }
        ans = max(ans,ans+tmp);
    }
    cout << ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:29: error: expected ';' before 'sort'
   24 |     sort(S.begin(), S.end())
      |                             ^
      |                             ;
   25 |     sort(T.begin(), T.end())
      |     ~~~~                     
a.cc:31:12: error: 'i' was not declared in this scope
   31 |     while (i <= N) {
      |            ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:22:25: error: 'o' was not declared in this scope
   22 |       if (blue.at(j) == o) {
      |                         ^
a.cc:27:24: error: 'o' was not declared in this scope
   27 |       if (red.at(j) == o) {
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N, M;
  cin >> N;
  map<string, int> plusMap;
  for(int i=0; i < N; i++)
  {
    string temp;
    cin >> temp;
    auto &iter = plusMap.find(temp);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:30: error: cannot bind non-const lvalue reference of type 'std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, int> >&' to an rvalue of type 'std::map<std::__cxx11::basic_string<char>, int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> > >::iterator'}
   12 |     auto &iter = plusMap.find(temp);
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N, M;
  cin >> N;
  map<string, int> plusMap;
  for(int i=0; i < N; i++)
  {
    string temp;
    cin >> temp;
    auto &iter = plusMap.find(temp);
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:30: error: cannot bind non-const lvalue reference of type 'std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, int> >&' to an rvalue of type 'std::map<std::__cxx11::basic_string<char>, int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> > >::iterator'}
   12 |     auto &iter = plusMap.find(temp);
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:14:2: error: expected '}' at end of input
   14 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;cin>>n;string s="";
  map <string,int>mp;
  for(int i=0;i<n;i++){cin>>s;mp[s]++;}
  cin>>n;
  while(cin>>s)mp[s]--;
  int ans=0;
  for(auto mp:x){ans=max(ans, x.second);}
  cour<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: 'x' was not declared in this scope
   10 |   for(auto mp:x){ans=max(ans, x.second);}
      |               ^
a.cc:11:3: error: 'cour' was not declared in this scope
   11 |   cour<<ans<<endl;
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;cin>>n;string s="";
  map <string,int>mp;
  for(int i+0;i<n;i++){cin>>s;mp[s]++;}
  cin>>n;
  while(cin>>s)mp[s]--;
  int ans=0;
  for(auto mp:x){ans=max(ans, x.second);}
  cour<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: expected ';' before '+' token
    6 |   for(int i+0;i<n;i++){cin>>s;mp[s]++;}
      |            ^
      |            ;
a.cc:6:18: error: expected ')' before ';' token
    6 |   for(int i+0;i<n;i++){cin>>s;mp[s]++;}
      |      ~           ^
      |                  )
a.cc:6:19: error: 'i' was not declared in this scope
    6 |   for(int i+0;i<n;i++){cin>>s;mp[s]++;}
      |                   ^
a.cc:10:15: error: 'x' was not declared in this scope
   10 |   for(auto mp:x){ans=max(ans, x.second);}
      |               ^
a.cc:11:3: error: 'cour' was not declared in this scope
   11 |   cour<<ans<<endl;
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
#def rep(i, n) for(int i=0;i<int(n); i++)
using namespace std;
int main(){
  int n;cin>>n;string s[n];rep(i,n){cin>>s[i];}
  int m;cin>>m;string t[n];rep(i,m){cin>>t[i];}
  map<string, int> red;
  map<string, int> blue;
  rep(i, n){red[s[i]]++;}
  rep(i, m){blue[t[i]]++;}
  int scr=0, tmp=0;
  for (const auto& [key, value] : blue){
        if(red[key]!=null)tmp=blue[key]-red[key];else tmp = blue[key];
    (scr<tmp?scr=tmp:);
    }
  cout<<scr<<endl;
  
}

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #def; did you mean #ifdef?
    2 | #def rep(i, n) for(int i=0;i<int(n); i++)
      |  ^~~
      |  ifdef
a.cc: In function 'int main()':
a.cc:5:32: error: 'i' was not declared in this scope
    5 |   int n;cin>>n;string s[n];rep(i,n){cin>>s[i];}
      |                                ^
a.cc:5:28: error: 'rep' was not declared in this scope
    5 |   int n;cin>>n;string s[n];rep(i,n){cin>>s[i];}
      |                            ^~~
a.cc:13:22: error: 'null' was not declared in this scope
   13 |         if(red[key]!=null)tmp=blue[key]-red[key];else tmp = blue[key];
      |                      ^~~~
a.cc:14:22: error: expected primary-expression before ')' token
   14 |     (scr<tmp?scr=tmp:);
      |                      ^
Language: C++

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

int main(void)
{
    map<string, int> s;
    int N;
    cin >> N;
    for (int i = 0; i < N; i++) {
        string tmp;
        cin >> tmp;
        if (s.count(tmp) > 0) {
            s[tmp]++;
        }
        else {
            s.insert({tmp, 1});
        }
    }
    int M;
    cin >> M;
    for (int i = 0; i < M; i++) {
        string tmp;
        cin >> tmp;
        if (s.count(tmp) > 0) {
            s[tmp]--;
        }
        else {
            s.insert({tmp, -1});
        }

        int earn = 0;
        for (auto n: s)
            earn = max(earn, n.second);
    }
    
    cout << earn << endl;
}


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

import java.util.*;
public calss Main{
	public cstatic void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      String[] s = new String[n];
      for(int i = 0;i < n;i++)s[i] = sc.next();
      int m = sc.nextInt();
      String[] t = new String[m];
      for(int i = 0;i < m;i++)t[i] = sc.next();
      int count = -1;
      int max = 0;
      for(int i = 0;i < n;i++){
      	for(int j = 0;j < n;j++){
        	if(s[i].equals(s[j]))count++;
        }
        for(int k = 0;k < m;k++){
        	if(s[i].equals(t[k]))count--;
        }
        max = Math.max(max,count);
      }
      System.out.println(max);
    }
}

Compiler output:
Main.java:2: error: class, interface, enum, or record expected
public calss Main{
       ^
Main.java:3: error: class, interface, enum, or record expected
	public cstatic void main(String[] args){
	       ^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
      int n = sc.nextInt();
      ^
  (use --enable-preview to enable unnamed classes)
Main.java:7: error: class, interface, enum, or record expected
      for(int i = 0;i < n;i++)s[i] = sc.next();
      ^
Main.java:7: error: class, interface, enum, or record expected
      for(int i = 0;i < n;i++)s[i] = sc.next();
                    ^
Main.java:7: error: class, interface, enum, or record expected
      for(int i = 0;i < n;i++)s[i] = sc.next();
                          ^
Main.java:10: error: class, interface, enum, or record expected
      for(int i = 0;i < m;i++)t[i] = sc.next();
      ^
Main.java:10: error: class, interface, enum, or record expected
      for(int i = 0;i < m;i++)t[i] = sc.next();
                    ^
Main.java:10: error: class, interface, enum, or record expected
      for(int i = 0;i < m;i++)t[i] = sc.next();
                          ^
Main.java:13: error: class, interface, enum, or record expected
      for(int i = 0;i < n;i++){
      ^
Main.java:13: error: class, interface, enum, or record expected
      for(int i = 0;i < n;i++){
                    ^
Main.java:13: error: class, interface, enum, or record expected
      for(int i = 0;i < n;i++){
                          ^
Main.java:14: error: class, interface, enum, or record expected
      	for(int j = 0;j < n;j++){
      	              ^
Main.java:14: error: class, interface, enum, or record expected
      	for(int j = 0;j < n;j++){
      	                    ^
Main.java:16: error: class, interface, enum, or record expected
        }
        ^
Main.java:17: error: class, interface, enum, or record expected
        for(int k = 0;k < m;k++){
                      ^
Main.java:17: error: class, interface, enum, or record expected
        for(int k = 0;k < m;k++){
                            ^
Main.java:19: error: class, interface, enum, or record expected
        }
        ^
Main.java:21: error: class, interface, enum, or record expected
      }
      ^
Main.java:23: error: class, interface, enum, or record expected
    }
    ^
20 errors
Language: C++

#include <stdc++.h>

using namespace std;

int main() {
  map<string,int> mp;
  int n,m;
  cin>>n>>m;
  while (n--) {
    string x; cin>>x;
    mp[x]++;
  }
  while(m--) {
    string x; cin>>x;
    mp[x]--;
  }
  string best = "";
  for (auto p: mp) {
    if (best == "" || mp[best] < p.second) best = p.first;
  }
  if (mp[best]>=0) {
    cout<<best<<endl;
  } else {
    string buf = "aaaaaaaaaa";
    int i = 0;
    while (mp.count(buf)) {
      while (buf[i]=='z') i++;
      buf[i]+=1;
    }
    cout<<buf<<endl;
  }
  return 0;
}


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

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

int main(){
  int N,M;
  cin>>N;
  vector<string> blue(N);
  for (int i=0;i<N;i++){
    cin >>blue.at(i);
  }
  cin >>M;
  vector<string> red(M);
  for (int i=0);i<M;i++){
    cin >>red.at(i);
  }
  int sum=0;
  for (int i=0; i<N;i++){
    int breaker=0, count=0;
    for(int x=0;x<i;x++){
      breaker++;
      if (blue.at(i)==blue.at(x)){
        break;
      }
    }
    if (breaker!=i){
      break;
    }
    for (int x=i+1;x<N;x++){
      if(blue.at(i)==blue.at(x)){
        count++;
      }
    }
    for (int x=0;x<M;x++){
      if (blue.at(i) == red.at(x)){
        cunt--;
      }
    }
    if (count>0){
      sum+= count;
    }
  }
  cout <<sum <<endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: expected ';' before ')' token
   13 |   for (int i=0);i<M;i++){
      |               ^
      |               ;
a.cc:13:15: error: expected primary-expression before ')' token
a.cc:13:15: error: expected ';' before ')' token
   13 |   for (int i=0);i<M;i++){
      |               ^
      |               ;
a.cc:13:17: error: 'i' was not declared in this scope
   13 |   for (int i=0);i<M;i++){
      |                 ^
a.cc:35:9: error: 'cunt' was not declared in this scope; did you mean 'count'?
   35 |         cunt--;
      |         ^~~~
      |         count
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<string> vecb(N);
  
  for(int i = 0; i < N ; i++){
    cin >> vecb.at(i);
  }
  
  int M;
  vector<string> vecr(M);
  
  for(int i = 0; i < M ; i++){
    cin >> vecr.at(i);
  }
  
  vector<int> sb(N), sr(M);
  
  for(int i = 0; i < N ; i++){
    int b, r;
    b = 0;
    r = 0; 
    
    string s = vecb.at(i);
    
    for(int j = 0; j < N; j++){
      if( s == vecb.at(j)){
          b ++;
      }
    }
    for(int k = 0; k < M; k++){
      if(s == vecr.at(k)){
        r ++;
      }
    }
    
    sb.at(i) = b-r;
  }
  
  for(int i = 0; i < M ; i++){
    int b, r;
    b = 0;
    r = 0; 
    
    string s = vecr.at(i);
    
    for(int j = 0; j < N; j++){
      if( s == vecb.at(j)){
          b ++;
      }
    }
    for(int k = 0; k < M; k++){
      if(s == vecr.at(k)){
        r ++;
      }
    }
    
    sr.at(i) = b-r;
  }
  
  sort(sb.begin(), sb.end());
  sort(sr.begin(), sr.end());
  
  int b = sb.at(N-1);
  int r = sr.at(M-1);
  
  int x = max(b, r);
  cout << max(x, 0) << endl;
        
  
  #include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  vector<string> vecb(N);
  
  for(int i = 0; i < N ; i++){
    cin >> vecb.at(i);
  }
  
  int M;
  vector<string> vecr(M);
  
  for(int i = 0; i < M ; i++){
    cin >> vecr.at(i);
  }
  
  vector<int> sb(N), sr(M);
  
  for(int i = 0; i < N ; i++){
    int b, r;
    b = 0;
    r = 0; 
    
    string s = vecb.at(i);
    
    for(int j = 0; j < N; j++){
      if( s == vecb.at(j)){
          b ++;
      }
    }
    for(int k = 0; k < M; k++){
      if(s == vecr.at(k)){
        r ++;
      }
    }
    
    sb.at(i) = b-r;
  }
  
  for(int i = 0; i < M ; i++){
    int b, r;
    b = 0;
    r = 0; 
    
    string s = vecr.at(i);
    
    for(int j = 0; j < N; j++){
      if( s == vecb.at(j)){
          b ++;
      }
    }
    for(int k = 0; k < M; k++){
      if(s == vecr.at(k)){
        r ++;
      }
    }
    
    sr.at(i) = b-r;
  }
  
  reverse(sort(sb.begin(), sb.end()));
  reverse(sort(sr.begin(), sr.end()));
  
  int b = sb.at(0);
  int r = sr.at(0);
  
  int x = max(b, r);
  cout << max(x, 0) << endl;
        
 
}

}


Compiler output:
a.cc: In function 'int main()':
a.cc:77:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   77 | int main() {
      |         ^~
a.cc:77:9: note: remove parentheses to default-initialize a variable
   77 | int main() {
      |         ^~
      |         --
a.cc:77:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:77:12: error: a function-definition is not allowed here before '{' token
   77 | int main() {
      |            ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<string> vecb(N);
  
  for(int i = 0; i < N ; i++){
    cin >> vecb.at(i);
  }
  
  int M;
  vector<string> vecr(M);
  
  for(int i = 0; i < M ; i++){
    cin >> vecr.at(i);
  }
  
  vector<int> sb(N), sr(M);
  
  for(int i = 0; i < N ; i++){
    int b, r;
    b = 0;
    r = 0; 
    
    string s = vecb.at(i);
    
    for(int j = 0; j < N; j++){
      if( s == vecb.at(j)){
          b ++;
      }
    }
    for(int k = 0; k < M; k++){
      if(s == vecr.at(k)){
        r ++;
      }
    }
    
    sb.at(i) = b-r;
  }
  
  for(int i = 0; i < M ; i++){
    int b, r;
    b = 0;
    r = 0; 
    
    string s = vecr.at(i);
    
    for(int j = 0; j < N; j++){
      if( s == vecb.at(j)){
          b ++;
      }
    }
    for(int k = 0; k < M; k++){
      if(s == vecr.at(k)){
        r ++;
      }
    }
    
    sr.at(i) = b-r;
  }
  
  sort(sb.begin(), sb.end());
  sort(sr.begin(), sr.end());
  
  int b = sb.at(N-1);
  int r = sr.at(M-1);
  
  int x = max(b, r);
  cout << max(x, 0) << endl;
        
  
  #include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  vector<string> vecb(N);
  
  for(int i = 0; i < N ; i++){
    cin >> vecb.at(i);
  }
  
  int M;
  vector<string> vecr(M);
  
  for(int i = 0; i < M ; i++){
    cin >> vecr.at(i);
  }
  
  vector<int> sb(N), sr(M);
  
  for(int i = 0; i < N ; i++){
    int b, r;
    b = 0;
    r = 0; 
    
    string s = vecb.at(i);
    
    for(int j = 0; j < N; j++){
      if( s == vecb.at(j)){
          b ++;
      }
    }
    for(int k = 0; k < M; k++){
      if(s == vecr.at(k)){
        r ++;
      }
    }
    
    sb.at(i) = b-r;
  }
  
  for(int i = 0; i < M ; i++){
    int b, r;
    b = 0;
    r = 0; 
    
    string s = vecr.at(i);
    
    for(int j = 0; j < N; j++){
      if( s == vecb.at(j)){
          b ++;
      }
    }
    for(int k = 0; k < M; k++){
      if(s == vecr.at(k)){
        r ++;
      }
    }
    
    sr.at(i) = b-r;
  }
  
  reverse(sort(sb.begin(), sb.end()));
  reverse(sort(sr.begin(), sr.end()));
  
  int b = sb.at(0);
  int r = sr.at(0);
  
  int x = max(b, r);
  cout << max(x, 0) << endl;
        
 


}


Compiler output:
a.cc: In function 'int main()':
a.cc:77:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   77 | int main() {
      |         ^~
a.cc:77:9: note: remove parentheses to default-initialize a variable
   77 | int main() {
      |         ^~
      |         --
a.cc:77:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:77:12: error: a function-definition is not allowed here before '{' token
   77 | int main() {
      |            ^
a.cc:148:2: error: expected '}' at end of input
  148 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

/*問題文
高橋君は青いカードを N枚，赤いカードを M枚持っています.
カードにはそれぞれ文字列が書かれており， i枚目の青いカードに書かれている
文字列は si， i枚目の赤いカードに書かれている文字列は tiです。高橋君は，文字列を 1つ言います。
そして，全てのカードを確認し， その文字列が書かれた青いカードを 1枚見つけるごとに 1円貰えます。
また，その文字列が書かれた赤いカードを 1枚見つけるごとに 1円失います。
なお，高橋君の言った文字列と，カードに書かれた文字列が完全に一致していた場合のみを考えます。 
高橋君は，最大で差し引き何円貰うことができるでしょうか？
ただし，違うカードに同じ文字列が書かれていることもあることに注意してください。*/
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,m,m_reward=0;
  cin>>n>>m;
  vector<string> si(n),ti(m);
  for(int i=0;i<n;i++){
    int reward=0;
    for(int j=0;j<n;j++){
      if(si(i)==si(j))reward++;
    }
    for(int j=0;j<m;j++){
      if(si(i)==ti(j))reward--;
    }
    if(m_reward<reward)m_reward=reward;
  }
  cout<<m_reward<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   20 |       if(si(i)==si(j))reward++;
      |          ~~^~~
a.cc:20:19: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   20 |       if(si(i)==si(j))reward++;
      |                 ~~^~~
a.cc:23:12: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   23 |       if(si(i)==ti(j))reward--;
      |          ~~^~~
a.cc:23:19: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   23 |       if(si(i)==ti(j))reward--;
      |                 ~~^~~
Language: C++

/*問題文
高橋君は青いカードを N枚，赤いカードを M枚持っています.
カードにはそれぞれ文字列が書かれており， i枚目の青いカードに書かれている
文字列は si， i枚目の赤いカードに書かれている文字列は tiです。高橋君は，文字列を 1つ言います。
そして，全てのカードを確認し， その文字列が書かれた青いカードを 1枚見つけるごとに 1円貰えます。
また，その文字列が書かれた赤いカードを 1枚見つけるごとに 1円失います。
なお，高橋君の言った文字列と，カードに書かれた文字列が完全に一致していた場合のみを考えます。 
高橋君は，最大で差し引き何円貰うことができるでしょうか？
ただし，違うカードに同じ文字列が書かれていることもあることに注意してください。*/
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,m,m_reward=0;
  cin>>n>>m;
  vector<string> si(n),ti(m);
  for(int i=0;i<n;i++){
    int reward=0;
    for(int j=o;j<n;j++){
      if(si(i)==si(j))reward++;
    }
    for(int j=o;j<m;j++){
      if(si(i)==ti(j))reward-;
    }
    if(m_reward<reward)m_reward=reward;
  }
  cout<<m_reward<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:15: error: 'o' was not declared in this scope
   19 |     for(int j=o;j<n;j++){
      |               ^
a.cc:20:12: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   20 |       if(si(i)==si(j))reward++;
      |          ~~^~~
a.cc:20:19: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   20 |       if(si(i)==si(j))reward++;
      |                 ~~^~~
a.cc:22:15: error: 'o' was not declared in this scope
   22 |     for(int j=o;j<m;j++){
      |               ^
a.cc:23:12: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   23 |       if(si(i)==ti(j))reward-;
      |          ~~^~~
a.cc:23:19: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   23 |       if(si(i)==ti(j))reward-;
      |                 ~~^~~
a.cc:23:30: error: expected primary-expression before ';' token
   23 |       if(si(i)==ti(j))reward-;
      |                              ^
Language: C++

for i in range(int(input())):
	s = input()
    if s not in hmap: hmap[s] = 1
    else: hmap[s] += 1
      
for i in range(int(input())):
	s = input()
    if s not in hmap: hmap[s] = -1
    else: hmap[s] -= 1

m = 0
for k,v in hmap.items():
	m = max(m,v)
print(m)
      
  
  


Compiler output:
a.cc:1:1: error: expected unqualified-id before 'for'
    1 | for i in range(int(input())):
      | ^~~
Language: C++

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

int main() {
 vector<string> vec(200);
 vector<int> num(200);
 
 int N, M, i, j;
 string S;
 int size=0, judge=0;
 
 cin >> N;
 
 for (i=0; i<N; i++) { // 初めのN個に対してのループ（残りはMの値とM個の文字列）
   cin >> S;
   for (j=0; j<size+1; j++) { // 一つ余分に見ている
     if (S == vec.at(j)){ // もしvecに一致したものがあればnumをプラスする
       num.at(j)++;
       judge++;
       break;
     }
   }
   if(judge == 0){ // リストに一致しなかったとき；上のifが実行されなくてもこのifは必ず実行される
     vec.at(size) = S;
     num.at(size)++;
     size++;
   }
   judge=0;
 }
 
 cin >> M;
  
 for (i=0; i<M; i++){
   cin >> S;
   for (j=0; j<size+1; j+;){
     if (S == vec.at(j)){ // もしvecに一致したものがあればnumをマイナスする
       num.at(j)--;
       judge++;
       break;
     }
   }
   if(judge == 0){ // リストに一致しなかったとき；上のifが実行されなくてもこのifは必ず実行される
     vec.at(size) = S;
     num.at(size)--;
     size++;
     }   
   judge=0;
 }
  
 sort(num.begin(), num.end());
 reverse(num.begin(), num.end());
  
 cout << num.at(0) << endl;   
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:26: error: expected primary-expression before ';' token
   35 |    for (j=0; j<size+1; j+;){
      |                          ^
a.cc:35:26: error: expected ')' before ';' token
   35 |    for (j=0; j<size+1; j+;){
      |        ~                 ^
      |                          )
a.cc:35:27: error: expected primary-expression before ')' token
   35 |    for (j=0; j<size+1; j+;){
      |                           ^
Language: C++

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

int main(){
  int n, m;
  map<string, int> cards{};

  cin >> n;
  for( int i = 0; i < n; ++i ){
    string s;
    cin >> s;
    cards[s]++;
  }
  
  cin >> m;
  for(int i = 0; i < m; ++i){
    string t;
    cin >> t;
    cards[t]--;
  }

  int maxv = 0;
  for( auto x : cards ){
    maxv = max(maxv, x->first);
  }

  cout << maxv << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:23: error: base operand of '->' has non-pointer type 'std::pair<const std::__cxx11::basic_string<char>, int>'
   24 |     maxv = max(maxv, x->first);
      |                       ^~
Language: C++

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

int main(){
  int n, m;
  map<string, int> cards{};

  cin >> n;
  for( int i = 0; i < n; ++i ){
    string s;
    cin >> s;
    cards[s]++;
  }
  
  cin >> m;
  for(int i = 0; i < m; ++i){
    string t;
    cin >> t;
    cards[t]--;
  }

  int maxv = 0;
  for( auto x : cards ){
    maxv = max(maxv, cards.second);
  }

  cout << maxv << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:28: error: 'class std::map<std::__cxx11::basic_string<char>, int>' has no member named 'second'
   24 |     maxv = max(maxv, cards.second);
      |                            ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,m,ans=0;
  cin>>n;
  vector<int> data(n);
  for(int i=0;i<n;i++){
    cin>>datan[i];
  }
  cin>>m;
  vector<int> data(m);
  for(int i=0;i<m;i++){
    cin>>datam[i];
  }
  for(int i=0;i<n;i++){
    int c=0;
    for(int j=0;j<n;j++){
      if(datan[i]==datan[j]) c++;
    }
    for(int j=0;j<m;j++){
      if(datam[i]==datam[j]) c--;      
    }
    ans=max(ans,c);
  }
  
  
  cout<<ans<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'datan' was not declared in this scope; did you mean 'data'?
    9 |     cin>>datan[i];
      |          ^~~~~
      |          data
a.cc:12:15: error: redeclaration of 'std::vector<int> data'
   12 |   vector<int> data(m);
      |               ^~~~
a.cc:7:15: note: 'std::vector<int> data' previously declared here
    7 |   vector<int> data(n);
      |               ^~~~
a.cc:14:10: error: 'datam' was not declared in this scope; did you mean 'data'?
   14 |     cin>>datam[i];
      |          ^~~~~
      |          data
a.cc:19:10: error: 'datan' was not declared in this scope; did you mean 'data'?
   19 |       if(datan[i]==datan[j]) c++;
      |          ^~~~~
      |          data
a.cc:22:10: error: 'datam' was not declared in this scope; did you mean 'data'?
   22 |       if(datam[i]==datam[j]) c--;
      |          ^~~~~
      |          data
Language: C++

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


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: could not convert '(& s.std::vector<std::__cxx11::basic_string<char> >::at(((std::vector<std::__cxx11::basic_string<char> >::size_type)i)))->std::__cxx11::basic_string<char>::operator=((*(const std::__cxx11::basic_string<char>*)(& s.std::vector<std::__cxx11::basic_string<char> >::at(((std::vector<std::__cxx11::basic_string<char> >::size_type)j)))))' from 'std::__cxx11::basic_string<char>' to 'bool'
   26 |       if(s.at(i)=s.at(j))
      |          ~~~~~~~^~~~~~~~
      |                 |
      |                 std::__cxx11::basic_string<char>
a.cc:30:15: error: could not convert '(& s.std::vector<std::__cxx11::basic_string<char> >::at(((std::vector<std::__cxx11::basic_string<char> >::size_type)i)))->std::__cxx11::basic_string<char>::operator=((*(const std::__cxx11::basic_string<char>*)(& t.std::vector<std::__cxx11::basic_string<char> >::at(((std::vector<std::__cxx11::basic_string<char> >::size_type)k)))))' from 'std::__cxx11::basic_string<char>' to 'bool'
   30 |     if(s.at(i)=t.at(k))
      |        ~~~~~~~^~~~~~~~
      |               |
      |               std::__cxx11::basic_string<char>
a.cc:40:4: error: expected '}' at end of input
   40 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   for(i=0;i<N;i++){
      |       ^
a.cc:17:7: error: 'i' was not declared in this scope
   17 |   for(i=0;i<M;i++){
      |       ^
a.cc:24:7: error: 'i' was not declared in this scope
   24 |   for(i=0;i<N;i++){
      |       ^
a.cc:25:9: error: 'j' was not declared in this scope
   25 |     for(j=0;j<N;j++){
      |         ^
a.cc:29:7: error: 'k' was not declared in this scope
   29 |   for(k=0;k<M;k++){
      |       ^
a.cc:40:4: error: expected '}' at end of input
   40 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  
  int N;
  cin >> N;
  vector<string> vecN(N);
  
  for(int i = 0 ; i < N ; i++){
    cin >> vecN.at(i);
  }
  
  int M;
  cin >> M;
  vector<string> vecM(M);
  
  for(int i = 0 ; i < M ; i++){
    cin >> vecM.at(i);
  }
  
  vector<int> vecX(N);
  
  for(int i = 0 ; i < N ; i++ ){
    
    int sum = 0;
    
    for(int k = 0 ; k < N ; k++){
      if(vecN.at(i) == vecN.at(k)){
        sum ++;
      }
    }
      
    for(int k = 0 ; k < M ; k++){
      if(vecN.at(i) == vecM.at(k)){
         sum --;
      }
    }
    vecX.at(i) = sum;
  }
  
  if(N == 1){
    if(vecX.at(0) > 0){
      cout << vecX.at(0) << endl;
    }else{
      cout << 0 << endl;
    }
  }else{
    for(int i = 0 ; i < N-1 ; i++){
      if(vecX.at(i) > vecX.at(i+1)){
        vecX.at(i+1) = vecX.at(i);
      }
    }
    if(vecX.at(N-1) > 0){
      cout << vecX.at(N-1) <<endl;
    }else{
      cout << 0 << endl;
    }
  }
}
        
    
}

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

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

int main(){
    int N;
    cin >> N;
    vector<string> blue(N);
    for(int i = 0; i < N;i++){
        cin >> blue[i];
    }
    int M;
    cin >> M;
    vector<string> red(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;
}

Compiler output:
a.cc: In lambda function:
a.cc:21:23: error: 'blue' is not captured
   21 |         for(string t: blue) {
      |                       ^~~~
a.cc:19:18: note: the lambda has no capture-default
   19 |     auto calc = [](string s){
      |                  ^
a.cc:7:20: note: 'std::vector<std::__cxx11::basic_string<char> > blue' declared here
    7 |     vector<string> blue(N);
      |                    ^~~~
a.cc:24:24: error: 'red' is not captured
   24 |          for(string t: red) {
      |                        ^~~
a.cc:19:18: note: the lambda has no capture-default
   19 |     auto calc = [](string s){
      |                  ^
a.cc:13:20: note: 'std::vector<std::__cxx11::basic_string<char> > red' declared here
   13 |     vector<string> red(M);
      |                    ^~~
Language: C++

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

int main(){
    int N;
    cin >> N;
    vector<string> blue(N);
    for(int i = 0; i < N;i++){
        cin >> blue[i];
    }
    int M;
    cin >> M;
    vector<string> red(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:bule){
        ans = max(ans,calc(t));
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:18: error: 'bule' was not declared in this scope; did you mean 'blue'?
   30 |     for(string t:bule){
      |                  ^~~~
      |                  blue
Language: C++

#include <bits/stdc++.h>
using namespace std;
int calc(string s){
        int buf = 0;
        for(string t: blue) {
            if (t == s) buf++;
             }
         for(string t: red) {
            if (t == s) buf--;
            }
        return buf;
    }


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;
    
    for(string t:bule){
        ans = max(ans,calc(t));
    }
}

Compiler output:
a.cc: In function 'int calc(std::string)':
a.cc:5:23: error: 'blue' was not declared in this scope
    5 |         for(string t: blue) {
      |                       ^~~~
a.cc:8:24: error: 'red' was not declared in this scope; did you mean 'read'?
    8 |          for(string t: red) {
      |                        ^~~
      |                        read
a.cc: In function 'int main()':
a.cc:30:18: error: 'bule' was not declared in this scope; did you mean 'blue'?
   30 |     for(string t:bule){
      |                  ^~~~
      |                  blue
Language: C++

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

int main(){
    int N;
    cin >> N;
    vector<string> blue(N);
    for(int i = 0; i < N;i++){
        cin >> blue[i];
    }
    int M;
    cin >> M;
    vector<string> red(M);
    for(int i = 0; i < M;i++){
        cin >> red[i];
    }
    int ans = 0;
    int calc(string s){
        int buf = 0;
        for(string t: blue) {
            if (t == s) buf++;
             }
         for(string t: red) {
            if (t == s) buf--;
            }
        return buf;
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:23: error: a function-definition is not allowed here before '{' token
   18 |     int calc(string s){
      |                       ^
a.cc:29:18: error: 'bule' was not declared in this scope; did you mean 'blue'?
   29 |     for(string t:bule){
      |                  ^~~~
      |                  blue
a.cc:30:23: error: 'calc' was not declared in this scope
   30 |         ans = max(ans,calc(t));
      |                       ^~~~
Language: C++

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

int main() {
  int N;
  cin >> N;

  vector<string> blue(N);

  for(int i=0; i<N; i++) {
    cin >> blue.at(i);
  }

  int M;
  cin >> M;

  vector<string> red(M);

  for(int i=0; i<M; i++) {
    cin >> red.at(i);
  }

 int max = -100;

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

    for(int j=0; j<N; j++) {
      if(blue.at(i) == blue.at(j)) {
        count++;
      }
    for(int j=0; j<M; j++) {
      if(blue.at(i) == red.at(j)) {
        count--;
      }
    }
    if(max < count) {
      max = count;
    }
  }

  cout << max << endl;
}


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

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

int main() {
  int N;
  cin >> N;

  vector<string> blue(N);

  for(int i=0; i<N; i++) {
    cin >> blue.at(i);
  }

  int M;
  cin >> M;

  vector<string> red(M);

  for(int i=0; i<M; i++) {
    cin >> red.at(i);
  }

 int max = -100;

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

    for(int j=0; j<N; j++) {
      if(blue.at(i) == blue.at(j)) {
        count++;
      }
    for(int j=0; j<M; j++) {
      if(blue.at(i) == red.at(j)) {
        count--;
      }
    }
    if(max < count) {
      max = count;
    }
  }

  cout << max;
}


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

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

int main() {
  int N;
  cin >> N;

  vector<string> blue(N);

  for(int i=0; i<N; i++) {
    cin >> blue.at(i);
  }

  int M;
  cin >> M;

  vector<string> red(M);

  for(int i=0; i<M; i++) {
    cin >> red.at(i);
  }

  vector<int> count(N);
  for(int i=0; i<N; i++;) {
    for(int j=0; j<N; j++) {
      if(blue.at(i) == blue.at(j)) {
        count.at(i)++;
      }
    for(int j=0; j<M; j++) {
      if(blue.at(i) == red.at(j)) {
        count.at(i)--;
      }
    }
  }

  cout >> max_element(count.begin(), count.end());
}



Compiler output:
a.cc: In function 'int main()':
a.cc:24:24: error: expected ')' before ';' token
   24 |   for(int i=0; i<N; i++;) {
      |      ~                 ^
      |                        )
a.cc:24:25: error: expected primary-expression before ')' token
   24 |   for(int i=0; i<N; i++;) {
      |                         ^
a.cc:37:2: error: expected '}' at end of input
   37 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {
  int N;
  cin >> N;

  vector<string> blue(N);

  for(int i=0; i<N; i++) {
    cin >> blue.at(i);
  }

  int M;
  cin >> M;

  vector<string> red(M);

  for(int i=0; i<M; i++) {
    cin >> red.at(i);
  }

  vector<int> count(N);
  for(int i=0; i<N; i++;) {
    for(int j=0; j<N; j++;) {
      if(blue.at(i) == blue.at(j)) {
        count.at(i)++;
      }
    for(int j=0; j<M; j++;) {
      if(blue.at(i) == red.at(j)) {
        count.at(i)--;
      }
    }
  }

  cout >> max_element(count.begin(), count.end());
}



Compiler output:
a.cc: In function 'int main()':
a.cc:24:24: error: expected ')' before ';' token
   24 |   for(int i=0; i<N; i++;) {
      |      ~                 ^
      |                        )
a.cc:24:25: error: expected primary-expression before ')' token
   24 |   for(int i=0; i<N; i++;) {
      |                         ^
a.cc:37:2: error: expected '}' at end of input
   37 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

typedef long long int ll;
ll MOD = 1000000007;
ll INFL = 1ll << 60;
ll INF = 1 << 28;

// ====================================================================

int main() {
  int n,;
  cin >> n ;
  vector<string> ao(n);

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

int m;
cin >>m;
  vector<string> aka(m);

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

  int ans = 0;
  for (int i = 0; i < n; i++) {
    int kazoe = 0;
    for (int j = 0; j < n; j++) {
      if (ao[i] == ao[j]) {
        kazoe++;
      }
    }
    for (int k = 0; k < m; k++) {
      if (ao[i] == aka[k]) {
        kazoe--;
      }
    }
  ans = max(ans, kazoe);
}
cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: expected unqualified-id before ';' token
   12 |   int n,;
      |         ^
Language: C++

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

typedef long long int ll;
ll MOD = 1000000007;
ll INFL = 1ll << 60;
ll INF = 1 << 28;

// ====================================================================

int main() {
  int n,;
  cin >> n ;
  vector<string> ao(n);
int m;
cin >>m;
  vector<string> aka(m);

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

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

  int ans = 0;
  for (int i = 0; i < n; i++) {
    int kazoe = 0;
    for (int j = 0; j < n; j++) {
      if (ao[i] == ao[j]) {
        kazoe++;
      }
    }
    for (int k = 0; k < m; k++) {
      if (ao[i] == aka[k]) {
        kazoe--;
      }
    }
  ans = max(ans, kazoe);
}
cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: expected unqualified-id before ';' token
   12 |   int n,;
      |         ^
Language: C++

# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math

# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
def main():
    N = int(input())
    S = {}
    
    for i in range(N):
        tmp = input()
        if tmp in S:
            S[tmp] += 1
        else:
            S[tmp] = 1
            
    M = int(input())
    for i in range(M):
        tmp = input()
        if tmp in S:
            S[tmp] -= 1
        else:
            S[tmp] = -1
            
    ans = 0
    for v in S.values():
        if ans < v:
            ans = v
    
    print(ans)
    
	
if __name__ == "__main__":
	main()


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
a.cc:11:3: error: invalid preprocessing directive #NO
   11 | # NO, PAY-PAY
      |   ^~
a.cc:12:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
   12 | #import numpy as np
      |  ^~~~~~
a.cc:12:9: error: #import expects "FILENAME" or <FILENAME>
   12 | #import numpy as np
      |         ^~~~~
a.cc:13:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
   13 | #import statistics
      |  ^~~~~~
a.cc:13:9: error: #import expects "FILENAME" or <FILENAME>
   13 | #import statistics
      |         ^~~~~~~~~~
a.cc:14:2: error: invalid preprocessing directive #from
   14 | #from statistics import mean, median,variance,stdev
      |  ^~~~
a.cc:2:1: error: 'import' does not name a type
    2 | import sys
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:20:5: error: expected unqualified-id before 'for'
   20 |     for i in range(N):
      |     ^~~