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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'vec' was not declared in this scope; did you mean 'vecs'?
   11 |     vec.at(i) = s;
      |     ^~~
      |     vecs
a.cc:20:5: error: 'vec' was not declared in this scope; did you mean 'vect'?
   20 |     vec.at(j) = t;
      |     ^~~
      |     vect
a.cc:25:3: error: expected ',' or ';' before 'for'
   25 |   for (int i = 0; i < N; i++) {
      |   ^~~
a.cc:25:19: error: 'i' was not declared in this scope
   25 |   for (int i = 0; i < N; i++) {
      |                   ^
Language: C++

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

int main(){
  int N, M;
  cin >> N;
  vector <string> b_str(N);
  for (int i = 0; i < N; ++i){
    cin >> b_str.at(i);
  }
  cin >> M;
  vector <string> r_str(M);
  vector <string> merge_str_vec(N + M);
  for (int i = 0; i < M; ++i){
    cin >> r_str.at(i);
  }
  for(int i = 0; i < N; ++i){
    merge_str_vec.at(i) = b_str.at(i);
  }
  for(int i = 0; i < M; ++i){
    merge_str_vec.at(N + i) = r_str.at(i);
  }
  sort(merge_str_vec.begin(), merge_str_vec.end());
  merge_str_vec.erase(unique(merge_str_vec.begin(), merge_str_vec.end()), merge_str_vec.end());
  vector<int> point(merge_str_vec.size());

  for(int i = 0; i < merge_str_vec.size(); ++i){
    for(int j = 0; j < N; ++j){
      if (merge_str_vec.at(i) == b_str.at(j)){
	++point.at(i);
      }
    }
    for(int j = 0; j < M; ++j){
      if (merge_str_vec.at(i) == r_str.at(j)){
	--point.at(i);
      }
    }
  }
  if(*max_element(point.begin(), point.end()) > 0)
    cout << *max_element(point.begin(), point.end()) << endl;
  else
    cout << 0 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   24 |   sort(merge_str_vec.begin(), merge_str_vec.end());
      |   ^~~~
      |   short
a.cc:25:23: error: 'unique' was not declared in this scope
   25 |   merge_str_vec.erase(unique(merge_str_vec.begin(), merge_str_vec.end()), merge_str_vec.end());
      |                       ^~~~~~
a.cc:40:7: error: 'max_element' was not declared in this scope
   40 |   if(*max_element(point.begin(), point.end()) > 0)
      |       ^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int my_max(int x, int y) {
 
  if (x > y) {
    return x;
  }
  else {
    return y;
  }
  
int main() {
  int N, M;
  int ans=0;
  cin >> N;
  vector<string> vec_blue(N);
    for (int i=0;i<N;i++){
   cin >> vec_blue.at(i);
  }
  
  cin >> M;
  vector<string> vec_red(M);
   for (int i=0;i<M;i++){
   cin >> vec_red.at(i);
  }
  
  vector<int> vec_count(N,0);
   for(int i =0;i<N;i++){
     for (int j =0;j<N;j++){
    	 if (vec_blue.at(i) == vec_blue.at(j)){
           vec_count.at(i) += 1;
         }
 	 }
   }
   for(int i =0;i<N;i++){
     for (int j =0;j<M;j++){
    	 if (vec_blue.at(i) == vec_red.at(j)){
           vec_count.at(i) -= 1;
         }
 	 }
   }
 	for(int i= 0;i<N;i++){
      ans =my_max(vec_count.at(i),ans);
    }
         
  
  
  cout << ans << endl;
  return 0;
}

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

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

int main() {
  int N, M;
  int ans=0;
  cin >> N;
  vector<string> vec_blue(N);
    for (int i=0;i<N;i++){
   cin >> vec_blue.at(i);
  }
  
  cin >> M;
  vector<string> vec_red(M);
   for (int i=0;i<M;i++){
   cin >> vec_red.at(i);
  }
  vector<int> vec_count(N,0);
   for(int i =0;i<N;i++){
     for (int j =0;j<N;j++){
    	 if (vec_blue.at(i) == vec_blue.at(j){
           vec_count.at(i) += 1;
         }
 	 }
   }
   for(int i =0;i<N;i++){
     for (int j =0;j<M;j++){
    	 if (vec_blue.at(i) == vec_red.at(j){
           vec_count.at(i) -= 1;
         }
 	 }
   }
 	for(int i= 0;i<N;i++){
      ans =max(vec_count.at(i),ans);
    }
         
  
  
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:46: error: expected ')' before '{' token
   21 |          if (vec_blue.at(i) == vec_blue.at(j){
      |             ~                                ^
      |                                              )
a.cc:24:10: error: expected primary-expression before '}' token
   24 |          }
      |          ^
a.cc:28:45: error: expected ')' before '{' token
   28 |          if (vec_blue.at(i) == vec_red.at(j){
      |             ~                               ^
      |                                             )
a.cc:31:10: error: expected primary-expression before '}' token
   31 |          }
      |          ^
Language: C++

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

int main() {
  int N, M;
  int ans=0;
  cin >> N;
  vector<string> vec_blue(N);
    for (int i=0;i<N;i++){
   cin >> vec_blue.at(i);
  }
  
  cin >> M;
  vector<string> vec_red(M);
   for (int i=0;i<M;i++){
   cin >> vec_red.at(i);
  }
  vector<int> vec_count(N,0);
   for(int i =0;i<N;i++){
     for (int j =0;j<N;j++){
    	 if (vec.blue.at(i) == vec.blue.at(j){
           vec_count.at(i) += 1;
         }
 	 }
   }
   for(int i =0;i<N;i++){
     for (int j =0;j<M;j++){
    	 if (vec_blue.at(i) == vec_red.at(j){
           vec_count.at(i) -= 1;
         }
 	 }
   }
 	for(int i= 0;i<N;i++){
      ans =max(vec_count.at(i),ans);
    }
         
  
  
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: 'vec' was not declared in this scope
   21 |          if (vec.blue.at(i) == vec.blue.at(j){
      |              ^~~
a.cc:21:46: error: expected ')' before '{' token
   21 |          if (vec.blue.at(i) == vec.blue.at(j){
      |             ~                                ^
      |                                              )
a.cc:24:10: error: expected primary-expression before '}' token
   24 |          }
      |          ^
a.cc:28:45: error: expected ')' before '{' token
   28 |          if (vec_blue.at(i) == vec_red.at(j){
      |             ~                               ^
      |                                             )
a.cc:31:10: error: expected primary-expression before '}' token
   31 |          }
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, j, i;
  cin >> a;
  c=0;
  vector<string> blue(a);
  for(i=0;i<a;i++) {
    cin >> blue.at(i);
  }
  cin >> b;
   vector<string> red(b);
  for(i=0;i<b;i++) {
    cin >> red.at(i);
  }
  for(i=1;i<a;i++) {
    d=0;
    for(j=0;j<a;j++) {
      if(blue.at(i) == blue.at(j)) {
        d++;
      }
      if(blue.at(i) == red.at(j)) {
        d--;
      }
         }
         if (d > c) {
           c=d
         }
         }
         cout << c << endl;
         }

Compiler output:
a.cc: In function 'int main()':
a.cc:27:15: error: expected ';' before '}' token
   27 |            c=d
      |               ^
      |               ;
   28 |          }
      |          ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, j, i;
  cin >> a;
  c=0;
  vector<int> point(100);
  vector<string> blue(a);
  for(i=0;i<a;i++) {
    cin >> blue.at(i);
  }
  cin >> b;
   vector<string> red(b);
  for(i=0;i<b;i++) {
    cin >> red.at(i);
  }
  for(i=1;i<a;i++) {
    for(j=0;j<a;j++) {
      if(blue.at(i) == blue.at(j)) {
        point.at(i)++;
      }
      if(blue.at(i) == red.at(j) {
        point.at(i)--;
      }
         }
         if (point.at(i) > c) {
           c=point.at(i);
         }
         }
         cout << c << endl;
         }

Compiler output:
a.cc: In function 'int main()':
a.cc:22:33: error: expected ')' before '{' token
   22 |       if(blue.at(i) == red.at(j) {
      |         ~                       ^~
      |                                 )
a.cc:25:10: error: expected primary-expression before '}' token
   25 |          }
      |          ^
Language: Java

package _200;

import java.util.Scanner;

public class B_TwoColorsCardGame {
//public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int result = 0;
		int N = sc.nextInt();
		String[] s = new String[N];
        int[] flag = new int[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();
		}

		for(int i = 0; i < N; i++) {
			int count = 0;
            if(flag[i] == 1) {
                break;
            }
			for(int j = i; j < N; j++) {
				if(s[i].equals(s[j])) {
					count++;
                    flag[j] = 1;
				}
			}
			for(int j = 0; j < M; j++) {
				if(s[i].equals(t[j])) {
					count--;
				}
			}
			result = Math.max(result, count);
		}

		System.out.println(result);
	}
}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:27: error: 'an' was not declared in this scope; did you mean 'ans'?
   18 |     for(auto u:mp)ans=max(an,u.second);
      |                           ^~
      |                           ans
Language: C++

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

int main() {
  int B, R;
  cin >> B;
  map<string,int>data;
  for(int i=0;i<B;i++){
    string s;
    cin >> s;
    if(data.count(s)) data.at(s)++;
    else data[s]=1;
  }
  cin >> R;
  for(int i=0;i<R;i++){
    string s;
    cin >> s;
    if(data.count(s)) data.at(s)--;
    else data[s]=-1;
  }
  int count=0;
  int a=data.size();
  for(auto p:data){
    auto value=p.second;
    count=max(value,count)
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:27: error: expected ';' before '}' token
   25 |     count=max(value,count)
      |                           ^
      |                           ;
   26 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int n,m,ans=0;
  cin >> n;
  vector<string> b(n);
  for(int i=0;i<n;i++)cin >> b.at(i);
  cin >> m;
  vector<string> r(m);
  for(int i=0;i<m;i++)cin >> r.at(i);
  auto calc = [&](string u){
    int buf = 0;
    for(string v : b){
      if(u == v)buf++;
    }
    for(string v : r){
      if(u == v)buf--;
    }
    return buf;
  };
  
  for(string u : b){
    calc(u);
    ans = max(ans,calc(v));
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:24: error: 'v' was not declared in this scope
   25 |     ans = max(ans,calc(v));
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int n,m,ans=0;
  cin >> n;
  vector<string> b(n);
  for(int i=0;i<n;i++)cin >> b.at(i);
  cin >> m;
  vector<string> r(m);
  for(int i=0;i<m;i++)cin >> r.at(i);
  auto calc = [&](string u){
    int buf = 0;
    for(v :string b){
      if(u == b)buf++;
      if(u == r)buf--;
    }
    return buf;
  };
  
  for(u : string b){
    calc(u);
    ans = max(ans,calc(v));
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In lambda function:
a.cc:14:11: error: found ':' in nested-name-specifier, expected '::'
   14 |     for(v :string b){
      |           ^
      |           ::
a.cc:14:9: error: 'v' has not been declared
   14 |     for(v :string b){
      |         ^
a.cc:18:5: error: expected primary-expression before 'return'
   18 |     return buf;
      |     ^~~~~~
a.cc:17:6: error: expected ';' before 'return'
   17 |     }
      |      ^
      |      ;
   18 |     return buf;
      |     ~~~~~~
a.cc:18:5: error: expected primary-expression before 'return'
   18 |     return buf;
      |     ^~~~~~
a.cc:17:6: error: expected ')' before 'return'
   17 |     }
      |      ^
      |      )
   18 |     return buf;
      |     ~~~~~~
a.cc:14:8: note: to match this '('
   14 |     for(v :string b){
      |        ^
a.cc: In function 'int main()':
a.cc:21:9: error: found ':' in nested-name-specifier, expected '::'
   21 |   for(u : string b){
      |         ^
      |         ::
a.cc:21:7: error: 'u' has not been declared
   21 |   for(u : string b){
      |       ^
a.cc:26:1: error: expected primary-expression before '}' token
   26 | }
      | ^
a.cc:25:23: error: expected ')' before '}' token
   25 |   cout << ans << endl;
      |                       ^
      |                       )
   26 | }
      | ~                      
a.cc:21:6: note: to match this '('
   21 |   for(u : string b){
      |      ^
a.cc:26:1: error: expected primary-expression before '}' token
   26 | }
      | ^
Language: C++

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

int main(){
  int n,m,ans=0;
  cin >> n;
  vector<string> b[n];
  for(int i=0;i<n;i++)cin >> b.at(i);
  cin >> m;
  vector<string> r[m];
  for(int i=0;i<m;i++)cin >> r.at(i);
  auto calc = [&](string u){
    int buf = 0;
    for(v :string b){
      if(u == b)buf++;
      if(u == r)buf--;
    }
    return buf;
  };
  
  for(u : string b){
    calc(u);
    ans = max(ans,calc(v));
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:32: error: request for member 'at' in 'b', which is of non-class type 'std::vector<std::__cxx11::basic_string<char> > [n]'
    8 |   for(int i=0;i<n;i++)cin >> b.at(i);
      |                                ^~
a.cc:11:32: error: request for member 'at' in 'r', which is of non-class type 'std::vector<std::__cxx11::basic_string<char> > [m]'
   11 |   for(int i=0;i<m;i++)cin >> r.at(i);
      |                                ^~
a.cc: In lambda function:
a.cc:14:11: error: found ':' in nested-name-specifier, expected '::'
   14 |     for(v :string b){
      |           ^
      |           ::
a.cc:14:9: error: 'v' has not been declared
   14 |     for(v :string b){
      |         ^
a.cc:18:5: error: expected primary-expression before 'return'
   18 |     return buf;
      |     ^~~~~~
a.cc:17:6: error: expected ';' before 'return'
   17 |     }
      |      ^
      |      ;
   18 |     return buf;
      |     ~~~~~~
a.cc:18:5: error: expected primary-expression before 'return'
   18 |     return buf;
      |     ^~~~~~
a.cc:17:6: error: expected ')' before 'return'
   17 |     }
      |      ^
      |      )
   18 |     return buf;
      |     ~~~~~~
a.cc:14:8: note: to match this '('
   14 |     for(v :string b){
      |        ^
a.cc: In function 'int main()':
a.cc:21:9: error: found ':' in nested-name-specifier, expected '::'
   21 |   for(u : string b){
      |         ^
      |         ::
a.cc:21:7: error: 'u' has not been declared
   21 |   for(u : string b){
      |       ^
a.cc:26:1: error: expected primary-expression before '}' token
   26 | }
      | ^
a.cc:25:23: error: expected ')' before '}' token
   25 |   cout << ans << endl;
      |                       ^
      |                       )
   26 | }
      | ~                      
a.cc:21:6: note: to match this '('
   21 |   for(u : string b){
      |      ^
a.cc:26:1: error: expected primary-expression before '}' token
   26 | }
      | ^
Language: C++

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

int main() {

    int n,m;
    cin >> n;
    vector<string> s(n);
    for(int i = 0; i < n; i++)  
        cin >> s[i];

    cin >> m;
    vector<string> t(m);
    for(int i = 0; i < m; i++)  
        cin >> t[i];

    int max = 0;

    for(int i = 0; i < n; i++){

        int prize = 0;

        for(int j = i; j < n ; j++){
            if(s[i] == s[j])
                prize++;
        }

        for(int k = 0; k < m; k++){
            if(s[i] == t[k])
                prize--;
        }
        

        if(prize > max)
             max = prize;

    }

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 <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main(){
	int n;
	cin >> n;
	map<string, int> mp;
	rep(i, n){
		string s;
		cin >> s;
		mp[s]++;
	}

	int m;
	cin >> m;
	rep(i, m){
		string t;
		cin >> t;
		mp[t]--;
	}

	int ans = 0;
	rep(i, mp.size()){
		ans = max(ans, mp[i]);
	}

	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:34: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, int>' and 'int')
   25 |                 ans = max(ans, mp[i]);
      |                                  ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'int' to 'const std::map<std::__cxx11::basic_string<char>, int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'int' to 'std::map<std::__cxx11::basic_string<char>, int>::key_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<string> a(N); 
  for(int i=0;i<N;i++) {
    cin >> a.at(i);
  }
  
  int M;
  cin >> M;
  vector<string> b.at(M);
  for(int j=0;j<M;j++) {
    cin >> b.at(j);
  }
  
  vector<int> x(N);
  for(int i=0;i<N;i++) {
    int z=0;
    for(int j=0;j<N;j++) {
      if(a.at(i)==a.at(j)&&i!=j) {
        z++;
      }
    }
    x.at(i)=z;
  }
  
  vector<int> y(N);
  for(int i=0;i<N;i++) {
    int w=0;
    for(int j=0;j<M;j++) {
      if(a.at(i)==b.at(j)) {
        w++;
      }
    }
    y.at(i)=w;
  }
  
  int n=x.at(0)-y.at(0);
  for(int i=1;i<N;i++) {
    if(x.at(i)-y.at(i)>n) {
      n=x.at(i)-y.at(i);
    }
  }
  if(n<0) {
    cout << 0 << endl;
  }
  else {
    cout << n << endl;
  }
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: expected initializer before '.' token
   14 |   vector<string> b.at(M);
      |                   ^
a.cc:16:12: error: 'b' was not declared in this scope
   16 |     cin >> b.at(j);
      |            ^
a.cc:34:19: error: 'b' was not declared in this scope
   34 |       if(a.at(i)==b.at(j)) {
      |                   ^
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=0, count;
  string NON = "non"
  for(int i=0;i<N;i++){
    count=1;
    if(s[i] == NON) continue;
    if(i!=N-1){
      for(int j=i+1; j<N;j++){
        if(s[i] == s[j]){
          count++;
          s[j] = NON;
        }
      }
    }
    for(int k; k<M; k++){
      if(count < 0) break;
      if(s[i]==t[k]) count--;
    }
    if(count>max) max = count;
  }
  
  cout << max << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: expected ',' or ';' before 'for'
   16 |   for(int i=0;i<N;i++){
      |   ^~~
a.cc:16:15: error: 'i' was not declared in this scope
   16 |   for(int i=0;i<N;i++){
      |               ^
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=0, count;
  
  for(int i=0;i<N;i++){
    count=1;
    if(s.at(i) = "non") continue;
    for(int j=i+1; j<N;j++){
      if(s.at(i) == s.at(j)){
        count++;
        s.at(j) = "non";
      }
    }
    for(int k; k<M; k++){
      if(count < 0) break;
      if(s.at(i)==t.at(k)) count--;
    }
    if(count>max) max = count;
  }
  
  cout << max << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: 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 char*)"non"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   18 |     if(s.at(i) = "non") continue;
      |        ~~~~~~~~^~~~~~~
      |                |
      |                std::__cxx11::basic_string<char>
Language: C++

#include <iostream> 
#include <cstdlib>
#include <cmath>
#include <vector>
#include <set>

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++) 

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);
    }
    
    sort(s.begin(), s.end());
    set<string> S(s.begin(), s.end());
    vector<string> S1(S.begin(), S.end());
    int KindCounter_s = S1.size();
    
    vector<int> vec_s(KindCounter_s);
    int k = 0;
    for (int i = 0; i < KindCounter_s; i++) {
        if (S1[i] == s[k]) {
            vec_s[i] += 1;
            k++;
            i--;
        }
    }

    for (int i = 0; i < KindCounter_s; i++) {
        for (int j = 0; j < M; j++) {
            if (S1[i] == t[j]) {
                vec_s[i] -= 1;
            }
        }
    }
    int max = vec_s[0];
    for (int i = 0; i < KindCounter_s; i++) {
        if (max < vec_s[i]) {
            max = vec_s[i];
        }
    }

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



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

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

int main(){
  int n,m;
  cin >> n >> m;
  map<string,int> mp;
  vector<string> s(n);
  for (int i=0;i<n;++i) cin >> s[i];
  vector<string> t(m);
  for (int i=0;i<m;++i) cin >> t[i];

  for (int i=0;i<n;++i){
      mp[s[i]]++;
  }
  for (int i=0;i<m;++i){
      mp[t[i]]--;
  }
  for (auto i : mp) {
      ans = max(ans ,i.second);
  }
  cout << ans << endl;
  return 0;
}


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

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

int main() {
    int N,M;
    cin>>N;
    vector<string> s(N);
    for(int i=0;i<N;i++){
        cin>>s.at(i);
    }
    cin>>M;
    vector<string> t(M);
    for(int i=0;i<M;i++){
        cin>>t.at(i);
    }
    
    vector<int> ps(N);
    int psmax=0;
    vector<int> ms(M);
    int msmax=0;
    for(int i=0;i<N;i++){
        for(int k=0;k<N;k++){
            if(s.at(i)==s.at(k)){
                ps.at(k)++;
            }
        }
        for(int k=0;k<M;k++){
            if(s.at(i)==t.at(k)){
                ms.at(k)++;
            }
        }
    }

    for(int i=0;i<N;i++){
        if(psmax<=ps.at(i)){
            psmax=ps.at(i)
        }
    }

    for(int i=0;i<M;i++){
        if(msmax<=ms.at(i)){
            msmax=ms.at(i)
        }
    }
    
    cout<<psmax-msmax<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:27: error: expected ';' before '}' token
   36 |             psmax=ps.at(i)
      |                           ^
      |                           ;
   37 |         }
      |         ~                  
a.cc:42:27: error: expected ';' before '}' token
   42 |             msmax=ms.at(i)
      |                           ^
      |                           ;
   43 |         }
      |         ~
Language: C++

#include<stdio.h>

int epual(const char str1[], const char str2[]){
	int i;
	for(i = 0;str1[i] == str2[i];i++)
		if(str1[i] == '\0')
			return 0;
		return 1;
}

int main(void){
	int i,j;
	int N,M;
	int cnt = 0;
	
	
	char blue[100][11];
	char red[100][11];
	
	scanf("%d", N);
	
	for(i = 0;i < N;i++){
		scanf("%s", blue[i]);
	}
	
	scanf("%d", M);
	
	for(i = 0;i < M;i++){
		scanf("%s", red[i]);
	}
	
	for(i = 0;i < N;i++){
		int index = 0;
		for(j = 0;j < N;j++){
			if(equal(blue[i] , blue[i + j + 1]))
				index++;
		}
		
		for(j = 0;j < N;j++){
			if(equal(blue[i] , red[i + j + 1]))
				index--;
		}
		
		if(cnt < index)
			cnt = index;
	}
	
	printf("%d", cnt);
	
	return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:28: error: 'equal' was not declared in this scope; did you mean 'epual'?
   35 |                         if(equal(blue[i] , blue[i + j + 1]))
      |                            ^~~~~
      |                            epual
a.cc:40:28: error: 'equal' was not declared in this scope; did you mean 'epual'?
   40 |                         if(equal(blue[i] , red[i + j + 1]))
      |                            ^~~~~
      |                            epual
Language: C++

#include<stdio.h>

int epual(const char str1[], const char str2[]){
	int i;
	for(i = 0;str1[i] == str2[i];i++)
		if(str1[i] == '\0')
			return 0;
		return 1;
}

int main(void){
	int i,j;
	int N,M;
	int cnt = 0;
	
	
	char blue[100][11];
	char red[100][11];
	
	scanf("%d", N);
	
	for(i = 0;i < N;i++){
		scanf("%S", blue[i]);
	}
	
	scanf("%d", M);
	
	for(i = 0;i < M;i++){
		scanf("%S", red[i]);
	}
	
	for(i = 0;i < N;i++){
		int index = 0;
		for(j = 0;j < N;j++){
			if(equal(blue[i] , blue[i + j + 1]))
				index++;
		}
		
		for(j = 0;j < N;j++){
			if(equal(blue[i] , red[i + j + 1]))
				index--;
		}
		
		if(cnt < index)
			cnt = index;
	}
	
	printf("%d", cnt);
	
	return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:28: error: 'equal' was not declared in this scope; did you mean 'epual'?
   35 |                         if(equal(blue[i] , blue[i + j + 1]))
      |                            ^~~~~
      |                            epual
a.cc:40:28: error: 'equal' was not declared in this scope; did you mean 'epual'?
   40 |                         if(equal(blue[i] , red[i + j + 1]))
      |                            ^~~~~
      |                            epual
Language: C++

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

int main(void) {
  int i, j;
  int N, M;
  int max = 0;
  int numbers[100] = {};
  char cards[100][11] = { { } };
  scanf("%d %d", &N, &M);
  for(i = 0;i < N;i++) {
    char temp[11];
    scanf("%s", temp);
    for(j = 0;j < 100;j++) {
      if(cards[j][0] == '\0' || strcmp(temp, cards[j]) == 0) break;
    }
    strcpy(cards[j][0], temp);
    numbers[j]++;
  }
  for(i = 0;i < M;i++) {
    char temp[11];
    scanf("%s", temp);
    for(j = 0;j < 100;j++) {
      if(cards[j][0] == '\0' || strcmp(temp, cards[j]) == 0) break;
    }
    strcpy(cards[j][0], temp);
    numbers[j]--;
  }
  for(i = 0;i < 100;i++) {
    if(max < numbers[i]) max = numbers[i];
  }
  printf("%d\n", max);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:22: error: invalid conversion from 'char' to 'char*' [-fpermissive]
   17 |     strcpy(cards[j][0], temp);
      |            ~~~~~~~~~~^
      |                      |
      |                      char
In file included from a.cc:2:
/usr/include/string.h:141:39: note:   initializing argument 1 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
a.cc:26:22: error: invalid conversion from 'char' to 'char*' [-fpermissive]
   26 |     strcpy(cards[j][0], temp);
      |            ~~~~~~~~~~^
      |                      |
      |                      char
/usr/include/string.h:141:39: note:   initializing argument 1 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
Language: C++

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

int main(void) {
  int i, j;
  int N, M;
  int max = 0;
  int numbers[100] = {};
  int cards[100][11] = { { } };
  scanf("%d %d", &N, &M);
  for(i = 0;i < N;i++) {
    char temp[11];
    scanf("%s", temp);
    for(j = 0;j < 100;j++) {
      if(cards[j][0] == '\0' || strcmp(temp, cards[j]) == 0) break;
    }
    strcpy(cards[j][0], temp);
    numbers[j]++;
  }
  for(i = 0;i < M;i++) {
    char temp[11];
    scanf("%s", temp);
    for(j = 0;j < 100;j++) {
      if(cards[j][0] == '\0' || strcmp(temp, cards[j]) == 0) break;
    }
    strcpy(cards[j][0], temp);
    numbers[j]--;
  }
  for(i = 0;i < 100;i++) {
    if(max < numbers[i]) max = numbers[i];
  }
  printf("%d\n", max);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:53: error: cannot convert 'int*' to 'const char*'
   15 |       if(cards[j][0] == '\0' || strcmp(temp, cards[j]) == 0) break;
      |                                              ~~~~~~~^
      |                                                     |
      |                                                     int*
In file included from a.cc:2:
/usr/include/string.h:156:50: note:   initializing argument 2 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
a.cc:17:22: error: invalid conversion from 'int' to 'char*' [-fpermissive]
   17 |     strcpy(cards[j][0], temp);
      |            ~~~~~~~~~~^
      |                      |
      |                      int
/usr/include/string.h:141:39: note:   initializing argument 1 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
a.cc:24:53: error: cannot convert 'int*' to 'const char*'
   24 |       if(cards[j][0] == '\0' || strcmp(temp, cards[j]) == 0) break;
      |                                              ~~~~~~~^
      |                                                     |
      |                                                     int*
/usr/include/string.h:156:50: note:   initializing argument 2 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
a.cc:26:22: error: invalid conversion from 'int' to 'char*' [-fpermissive]
   26 |     strcpy(cards[j][0], temp);
      |            ~~~~~~~~~~^
      |                      |
      |                      int
/usr/include/string.h:141:39: note:   initializing argument 1 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
Language: C++

#include<stdio.h>
#include<stdlib.h>

int main(void) {
  int i, j;
  int N, M;
  int maxi = 0;
  int numbers[100] = {};
  int cards[100][11] = { { } };
  scanf("%d %d", &N, &M);
  for(i = 0;i < N;i++) {
    char temp[11];
    scanf("%s", temp);
    for(j = 0;j < 100;j++) {
      if(cards[j][0] == '\0' || strcmp(temp, cards[j]) == 0) break;
    }
    strcpy(cards[j][0], temp);
    numbers[j]++;
  }
  for(i = 0;i < M;i++) {
    char temp[11];
    scanf("%s", temp);
    for(j = 0;j < 100;j++) {
      if(cards[j][0] == '\0' || strcmp(temp, cards[j]) == 0) break;
    }
    strcpy(cards[j][0], temp);
    numbers[j]--;
  }
  for(i = 0;i < 100;i++) {
    if(maxi < numbers[i]) maxi = numbers[i];
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:33: error: 'strcmp' was not declared in this scope
   15 |       if(cards[j][0] == '\0' || strcmp(temp, cards[j]) == 0) break;
      |                                 ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<stdlib.h>
  +++ |+#include <cstring>
    3 | 
a.cc:17:5: error: 'strcpy' was not declared in this scope
   17 |     strcpy(cards[j][0], temp);
      |     ^~~~~~
a.cc:17:5: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:24:33: error: 'strcmp' was not declared in this scope
   24 |       if(cards[j][0] == '\0' || strcmp(temp, cards[j]) == 0) break;
      |                                 ^~~~~~
a.cc:24:33: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:26:5: error: 'strcpy' was not declared in this scope
   26 |     strcpy(cards[j][0], temp);
      |     ^~~~~~
a.cc:26:5: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<stdio.h>

int main(void) {
  int i, j;
  int N, M;
  int maxi = 0;
  int numbers[100] = {};
  int cards[100][11] = { { } };
  scanf("%d %d", &N, &M);
  for(i = 0;i < N;i++) {
    char temp[11];
    scanf("%s", temp);
    for(j = 0;j < 100;j++) {
      if(cards[j][0] == '\0' || strcmp(temp, cards[j]) == 0) break;
    }
    strcpy(cards[j][0], temp);
    numbers[j]++;
  }
  for(i = 0;i < M;i++) {
    char temp[11];
    scanf("%s", temp);
    for(j = 0;j < 100;j++) {
      if(cards[j][0] == '\0' || strcmp(temp, cards[j]) == 0) break;
    }
    strcpy(cards[j][0], temp);
    numbers[j]--;
  }
  for(i = 0;i < 100;i++) {
    if(maxi < numbers[i]) maxi = numbers[i];
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:33: error: 'strcmp' was not declared in this scope
   14 |       if(cards[j][0] == '\0' || strcmp(temp, cards[j]) == 0) break;
      |                                 ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<stdio.h>
  +++ |+#include <cstring>
    2 | 
a.cc:16:5: error: 'strcpy' was not declared in this scope
   16 |     strcpy(cards[j][0], temp);
      |     ^~~~~~
a.cc:16:5: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:23:33: error: 'strcmp' was not declared in this scope
   23 |       if(cards[j][0] == '\0' || strcmp(temp, cards[j]) == 0) break;
      |                                 ^~~~~~
a.cc:23:33: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:25:5: error: 'strcpy' was not declared in this scope
   25 |     strcpy(cards[j][0], temp);
      |     ^~~~~~
a.cc:25:5: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <bits/stdc++.h>
using namespace std;
map<string , int> cnt;

int main() {
    int N;
    cin >> N;
    string s;
    int M;
    cin >> M;
    string t;
    int ans = 0;
    for(int i = 0; i < N; i++) {
        cin >> s;
        cnt[s]++;
    }
    for(int i = 0; i < M; i++) {
        cin >> t;
        cnt[t]--;
    }
    for(auto x , cnt) {
        ans = max(ans, x.second);
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: declaration of 'auto x' has no initializer
   21 |     for(auto x , cnt) {
      |         ^~~~
a.cc:21:21: error: expected ';' before ')' token
   21 |     for(auto x , cnt) {
      |                     ^
      |                     ;
a.cc:21:21: error: expected primary-expression before ')' token
a.cc:21:21: error: expected ';' before ')' token
   21 |     for(auto x , cnt) {
      |                     ^
      |                     ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
map<string , int> cnt;

int main() {
    int N;
    cin >> N;
    vector<string>s(N);
    int M;
    cin >> M;
    vector<string>t(M);
    int ans = 0;
    for(int i = 0; i < N; i++) {
        cin >> s[i];
        cnt[s[i]]++;
    }
    for(int i = 0; i < M; i++) {
        cin >> t[i];
        cnt[t[i]]--;
    }
    for(x : cnt) {
        ans = max ( ans, x);
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:11: error: found ':' in nested-name-specifier, expected '::'
   21 |     for(x : cnt) {
      |           ^
      |           ::
a.cc:21:9: error: 'x' has not been declared
   21 |     for(x : cnt) {
      |         ^
a.cc:25:1: error: expected primary-expression before '}' token
   25 | }
      | ^
a.cc:24:25: error: expected ')' before '}' token
   24 |     cout << ans << endl;
      |                         ^
      |                         )
   25 | }
      | ~                        
a.cc:21:8: note: to match this '('
   21 |     for(x : cnt) {
      |        ^
a.cc:25:1: error: expected primary-expression before '}' token
   25 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
map<string , int> cnt;
int main() {
    int N;
    cin >> N;
    vector<string>s(N);
    int M;
    cin >> M;
    vector<string>t(N);
    int ans = 0;
    for(int i = 0; i < N; i++) {
        cin >> s[i];
        cnt[s[i]]++;
    }
    for(int i = 0; i < M; i++) {
        cin >> t[i];
        cnt[t[i]]--;
    }
    for(int i = 0; i < max(N,M); i++) {
        ans = max(ans , cnt[i]);
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:28: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, int>' and 'int')
   21 |         ans = max(ans , cnt[i]);
      |                            ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'int' to 'const std::map<std::__cxx11::basic_string<char>, int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'int' to 'std::map<std::__cxx11::basic_string<char>, int>::key_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
Language: C++


int main(){
    
    int N, M;
    map<int, string> s{}, t{};
    cin >> N;
    for(int i=1; i<=N; i++){
        cin >> s[i];
    }
    cin >> M;
    for(int i=1; i<=M; i++){
        cin >> t[i];
    }
    
    int moneymax=1, money=1;
    for(int i=1; i<=N; i++){
        for(int j=i+1; j<=N; j++){
            if(s[i]==s[j]){
                money++;
            }
        }
        for(int j=1; j<=M; j++){
            if(s[i]==t[j]){
                money--;
            }
        }
        if(moneymax<money){
            moneymax=money;
        }
        money=0;
    }
    
    
    cout << moneymax << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'map' was not declared in this scope
    5 |     map<int, string> s{}, t{};
      |     ^~~
a.cc:5:9: error: expected primary-expression before 'int'
    5 |     map<int, string> s{}, t{};
      |         ^~~
a.cc:5:25: error: expected primary-expression before ',' token
    5 |     map<int, string> s{}, t{};
      |                         ^
a.cc:5:27: error: 't' was not declared in this scope
    5 |     map<int, string> s{}, t{};
      |                           ^
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> N;
      |     ^~~
a.cc:8:16: error: 's' was not declared in this scope
    8 |         cin >> s[i];
      |                ^
a.cc:18:16: error: 's' was not declared in this scope
   18 |             if(s[i]==s[j]){
      |                ^
a.cc:23:16: error: 's' was not declared in this scope
   23 |             if(s[i]==t[j]){
      |                ^
a.cc:34:5: error: 'cout' was not declared in this scope
   34 |     cout << moneymax << endl;
      |     ^~~~
a.cc:34:25: error: 'endl' was not declared in this scope
   34 |     cout << moneymax << endl;
      |                         ^~~~
Language: C++

#include <iostream>
using namespace std;

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


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

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: expected unqualified-id before '=' token
   26 |     plus=max(plus1,plus2);
      |         ^
a.cc:28:13: error: missing template arguments before '<<' token
   28 |   cout<<plus<<endl;
      |             ^~
Language: C

#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){
	int a,b,ans=0;
	string s1[100],s2[100];
	cin>>a;
	for(int i=0;i<a;i++){
		cin>>s1[i];
	}
	cin>>b;
	for(int i=0;i<b;i++){
		cin>>s2[i];
	}
	for(int i=0;i<a;i++){
		int sum=0;
		for(int j=0;j<a;j++){
			if(s1[i]==s1[j])
				sum++;
		}
		for(int j=0;j<b;j++){
			if(s1[i]==s2[j])
				sum--;
		}
		if(sum>ans)
			ans=sum;
	}
	cout<<ans<<endl;
  return 0;
}

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

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

int main(){
  int j,N,M;
  int max1=0,tmp,tmp2;
  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);
  }
  sort(blue.begin(),blue.end());
  sort(red.begin(),red.end());
  for(int i=0;i<N;i++){
    tmp=1;
    for(int j=0;j<M;j++){
      if(blue.at(i)==red.at(j))
        tmp--;
    }
    if(i==N-1){
      max1=max(tmp,max1)
      break;
    }
    for(int k=i+1;k<N;k++){
      if(blue.at(i)==blue.at(k)){
        tmp++;
      }
      else{
        i=k-1;
        break;
      }
    }
    max1=max(max1,tmp);
  }
  cout << max1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:25: error: expected ';' before 'break'
   26 |       max1=max(tmp,max1)
      |                         ^
      |                         ;
   27 |       break;
      |       ~~~~~
Language: C++

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

int main(){
    int n;
    cin >> n;
    int ans = 0;
    vector<string> a(n);
    rep(i,n) cin >> a[i];
    int m;
    cin >> m;
    vector<string> t(m);
    rep(i,m) cin >> t[i];
    vector<string> r(n);
    sort(a.begin(),a.end());
    r[0] = a[0];
    rep(i,n){
        int j = 1;
        if(a[i] != a[i+1]) {
            r[j] = a[i+1];
            j++;
        }
    }
    rep(j,n){
        int cnt = 0;
        rep(i,max(n,m)){
            if(a[i] == r[j])cnt++;
            if(b[i] == r[j])cnt--;
        }
        ans = max(ans,cnt);
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:16: error: 'b' was not declared in this scope
   31 |             if(b[i] == r[j])cnt--;
      |                ^