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

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) cout << (x) << endl;
#define sz(x) int(x.size())
 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const int INF = 1e9;
const ll LLINF = 1e16;

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}
 
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};


ll countMinimalReplacements(string s) 
{ 
    ll n = s.length(); 
  
    ll cnt = 0; 
  
    for (ll i = 1; i < n; i++) { 
 
        if (s[i] == s[i - 1]) { 
            cnt += 1; 
 
            if (i != (n - 1)) { 
 
                for (auto it : "abcdefghijklmnopqrstuvwxyz") { 
                    if (it != s[i + 1] && 
                        it != s[i - 1]) { 
                        s[i] = it; 
                        break; 
                    } 
                } 
            } 
  
            else
            { 
                for (auto it : "abcdefghijklmnopqrstuvwxyz") { 
                    if (it != s[i - 1]) { 
                        s[i] = it; 
                        break; 
                    } 
                } 
            } 
        } 
    } 
  
    return cnt; 
} 

int main(void){
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    int n;
    string s;
    cin >> n >> s;
    int ans = 0;
    REP(i,1,n){
        set<char> st;
        int tmp = 0;
        rep(k,i){
            st.insert(s[k]);
        }
        REP(j, i+1, n){
            if(st.find(s[j])){
                tmp++;
            }
        }
        chmax(ans,tmp);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:92:23: error: could not convert 'st.std::set<char>::find((*(const std::set<char>::key_type*)(& s.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)j)))))' from 'std::set<char>::iterator' {aka 'std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>, std::allocator<char> >::const_iterator'} to 'bool'
   92 |             if(st.find(s[j])){
      |                ~~~~~~~^~~~~~
      |                       |
      |                       std::set<char>::iterator {aka std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>, std::allocator<char> >::const_iterator}
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
	int a;
	cin>>a;
	string b;
	cin>>b;
	
	int c=0;
	for(int i=1;i<n;i++){
		int d=0;
		
		for(char c='a';c<='z';c++){
			bool left=false,right=false;
			
			for(int j=0;j<i;j++)
				if(s[j]==c)
					left=true;
			
			for(int j=i;j<n;j++)
				if(s[j]==c)
					right=true;
			
			if(left&&right)
				d++;
		}
		
	
			c = max(c,d);
	}
	
	cout<< c <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: 'n' was not declared in this scope
   11 |         for(int i=1;i<n;i++){
      |                       ^
a.cc:18:36: error: 's' was not declared in this scope
   18 |                                 if(s[j]==c)
      |                                    ^
a.cc:22:36: error: 's' was not declared in this scope
   22 |                                 if(s[j]==c)
      |                                    ^
Language: C++

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

int func(string s,string t){
  int ans;
  for (char c='a';c<'z';c++){
    bool founds=false, foundt=false;
    rep(i,s.length()){
      if(s[i]==c){
        founds=true;
      }
    }
    rep(i,t.length()){
      if(t[i]==c){
        foundt=true;
      }
    }
    if(founds&&foundt)ans++;
  }
  return ans;
}
int main(){
  int N;
  string s;
  cin>>N>>s;
  int ans=0;
  rep(i,N){
    int tmp=fund(s.substr(0,i),s.substr(i));
    ans=max(ans,tmp);
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:13: error: 'fund' was not declared in this scope; did you mean 'func'?
   29 |     int tmp=fund(s.substr(0,i),s.substr(i));
      |             ^~~~
      |             func
Language: C++

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

int main(){
  int n,maxnum=0;
  string s,base="abcdefghijklmnopqrstuvwxyz";
  cin>>n>>s;
  int c=1;
  vector<bool> flag（base.size()）;
  while(c<n-maxnum){
  for(int i=0;i<base.size();i++){
    for(int x=0;x<c;x++){
      if(s.at(x)==base.at(i)){
        flag[i]=true;
        break;
      }else flag[i]=false;
    }
    if(flag[i]){
    for(int z=c;z<n;z++){
      if(s.at(z)==base.at(i)) break;
      if(z==n-1) flag[i]=false;
    }
    }
  }
    int count=0;
  for(int i=0;i<base.size();i++){
    if(flag[i]) count++;
  }
    maxnum=max(maxnum,count);
    c++;
  }
  cout<<maxnum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: expected initializer before '.' token
    9 |   vector<bool> flag（base.size()）;
      |                          ^
a.cc:14:9: error: 'flag' was not declared in this scope
   14 |         flag[i]=true;
      |         ^~~~
a.cc:16:13: error: 'flag' was not declared in this scope
   16 |       }else flag[i]=false;
      |             ^~~~
a.cc:18:8: error: 'flag' was not declared in this scope
   18 |     if(flag[i]){
      |        ^~~~
a.cc:27:8: error: 'flag' was not declared in this scope
   27 |     if(flag[i]) count++;
      |        ^~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <stdlib.h>

using namespace std;

int main() {
    int n;  cin >> n;
    string s;   cin >> s;
    int ans = 0

    for (int i = 0; i < n-1; i++) {
        string a = s.substr(0, 1+i), b = s.substr(i+1, n-i-1);
        int **c;
        c = (int **)malloc(sizeof(int*)*26);
        for (int j = 0; j < 26; j++)
            c[j] = (int *)calloc(2, sizeof(int));

        for (int k = 0; k < a.length(); k++)
            c[a[k] - 'a'][0]++;
        for (int k = 0; k < b.length(); k++)
            c[b[k] - 'a'][1]++;
        int cnt = 0;
        for (int k = 0; k < 26; k++) {
            if (c[k][1] > 0 && c[k][0] > 0)
                cnt++;
        }
        ans = max(ans, cnt);
    }   

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: expected ',' or ';' before 'for'
   13 |     for (int i = 0; i < n-1; i++) {
      |     ^~~
a.cc:13:21: error: 'i' was not declared in this scope
   13 |     for (int i = 0; i < n-1; i++) {
      |                     ^
Language: C++

#include <stdlib.h>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
	string s;
  	cin>>s;
  	rep(i,s.size()){
		string a="";
      	string b="";
      	rep(j,i){
			a+=s.at(j);
        }
      	rep(j,s.size()-i){
         	b+=s.at(j);
        }
		rep(j,a.size()){
        	rep(k,b.size()){
             
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:8:24: note: to match this '{'
    8 |         rep(i,s.size()){
      |                        ^
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: Java

import java.util.Collections;
import java.util.HashMap;
import java.util.Scanner;

public class Test {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		HashMap<String, Integer> map = new HashMap<String, Integer>();
		int N = sc.nextInt();
		String M = sc.next();
		for (int string_cnt = 0; string_cnt < N; string_cnt++ ){
			String  target = M.substring(string_cnt,string_cnt+1);
			if (map.containsKey(target)){
				map.put(target, map.get(target) + 1);
			}
			else{
				map.put(target,1);
			}
		}
		double ans = Math.ceil(Collections.max(map.values()) / 2);
		System.out.println(ans);


}}

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

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

int main(){
  int n;
  string s;
  cin >>n>>s;	
  int ans=0;
  for(int i=1;i<n;i++){
    int co = 0;  
    for(char c='a';c<='z';c++){
      bool left=false;
      bool right=false;      
      for(int j=0;j<i;j++) if(s[j]==c) left=true;
      for(int j=i;j<N;j++) if(s[j]==c) right=true;			
      if(left and right) co++;
    }    
    if(ans<co) ans = co;
  }
	cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: 'N' was not declared in this scope
   15 |       for(int j=i;j<N;j++) if(s[j]==c) right=true;
      |                     ^
Language: C++

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

int main(){
  int n;
  string s;
  cin >>n>>s;	
  int ans=0;
  for(int i=1;i<n;i++){
    int co = 0;  
    for(char c='a';c<='z';c++){
      bool left=false;
      bool right=false;      
      for(int j=0;j<i;j++) if(S[j]==c) left=true;
      for(int j=i;j<N;j++) if(S[j]==c) right=true;			
      if(left and right) co++;
    }    
    if(ans<co) ans = co;
  }
	cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:31: error: 'S' was not declared in this scope
   14 |       for(int j=0;j<i;j++) if(S[j]==c) left=true;
      |                               ^
a.cc:15:21: error: 'N' was not declared in this scope
   15 |       for(int j=i;j<N;j++) if(S[j]==c) right=true;
      |                     ^
a.cc:15:31: error: 'S' was not declared in this scope
   15 |       for(int j=i;j<N;j++) if(S[j]==c) right=true;
      |                               ^
Language: C++

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

int main() {
    int n;
    string s;
    cin>>n>>s;
    int mx=0;
    for (int i=1;i<n;i++) {
        string t,u;
        t=s.substring(0,i);
        u=s.substring(i);
        set<char> a,b;
        for (char c:t)
            a.insert(c);
        for (char c:u)
            b.insert(c);
        int cnt=0;
        for (char c:a)
            if (b.count(c))
                cnt++;
        mx=max(mx,cnt);
    }
    cout<<mx<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'substring'; did you mean 'substr'?
   12 |         t=s.substring(0,i);
      |             ^~~~~~~~~
      |             substr
a.cc:13:13: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'substring'; did you mean 'substr'?
   13 |         u=s.substring(i);
      |             ^~~~~~~~~
      |             substr
Language: C++

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

int main(){
  int N;
  string S;
  cin >>N>>S;
	
  int ans=0;
  for(int i=1;i<n;i++){
    int k = 0;
    
    for(char c='a';c<='z';c++){
      bool left=false;
      bool right=false;
      
      for(int j=0;j<i;j++) if(s[j]==c) left=true;
      for(int j=i;j<n;j++) if(s[j]==c) right=true;
			
      if(left and right) cnt++;
    }
    
    if(ans<k) ans = k;
  }
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'n' was not declared in this scope
   10 |   for(int i=1;i<n;i++){
      |                 ^
a.cc:17:31: error: 's' was not declared in this scope
   17 |       for(int j=0;j<i;j++) if(s[j]==c) left=true;
      |                               ^
a.cc:18:31: error: 's' was not declared in this scope
   18 |       for(int j=i;j<n;j++) if(s[j]==c) right=true;
      |                               ^
a.cc:20:26: error: 'cnt' was not declared in this scope; did you mean 'int'?
   20 |       if(left and right) cnt++;
      |                          ^~~
      |                          int
Language: C++

#include <bits/stdc++.h>
#define BIT(n) (1LL << (n))
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPB(i, n) for (int i = 0; i < BIT(n); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORA(i, n) for (auto &&i : n)
#define FORS(i, m, n) for (int i = m; i <= n; i++)
#define DEBUG(x) cerr << #x << ": " << x << "\n"
#define PRINTALL(V)                                                            \
  for (auto v : (V)) {                                                         \
    cout << v << " ";                                                          \
  }                                                                            \
  cout << "\n";
#define ALL(v) v.begin(), v.end()
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define epb emplace_back
#define int long long
using namespace std;
template < class T > bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template < class T > bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template < class T > using vec = std::vector< T >;
template < class T > void print(const T &x) { cout << x << "\n"; }
const int MOD = 1000000007, INF = 1061109567;
const double EPS = 1e-10, PI = acos(-1.0);
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
signed main() {
  cin.tie(0), ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int N;
  string S;
  cin >> N >> S;
  int ans = -1;
  REPS(i, N - 1) {
    int curAns = 0;
    vec< vec< bool > > flg(2, vec< flg >(26, false));
    REP(j, i) { flg[0][S[j] - 'a'] = true; }
    FOR(j, i, N) { flg[1][S[j] - 'a'] = true; }
    REP(j, 26) {
      if (flg[0][j] && flg[1][j])
        curAns++;
    }
    chmax(ans, curAns);
  }
  print(ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:40: error: type/value mismatch at argument 1 in template parameter list for 'template<class T> using vec = std::vector<_Tp>'
   52 |     vec< vec< bool > > flg(2, vec< flg >(26, false));
      |                                        ^
a.cc:52:40: note:   expected a type, got 'flg'
Language: Java

import java.util.Scanner;

public class Main2 {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		String s = sc.next();
		
		int x = n/2;
		int y = n-x;
		
		String xStr = s.subString(0, x);
		String yStr = s.subString(x, y);

		int cnt = 0;
		for (int i = 0; i < x; i++) {
			String z = xStr.subString(i, i+1);
			if ( yStr.contains(z) ){
				cnt++;
			}
		}

		System.out.println(cnt);

		sc.close();

	}
}

Compiler output:
Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
Main.java:15: error: cannot find symbol
		String xStr = s.subString(0, x);
		               ^
  symbol:   method subString(int,int)
  location: variable s of type String
Main.java:16: error: cannot find symbol
		String yStr = s.subString(x, y);
		               ^
  symbol:   method subString(int,int)
  location: variable s of type String
Main.java:20: error: cannot find symbol
			String z = xStr.subString(i, i+1);
			               ^
  symbol:   method subString(int,int)
  location: variable xStr of type String
4 errors
Language: C++

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

int main(){
    int n;
    string s;
    cin >> n >> s;

    int ans = 0;
    for(int i=1;i<n;i++){
        int cnt = 0;
        for(char c='a';c<='z';c++){
            bool left=false,right=false;
            for(int j=0;j<i;j++){
                if(s[j] == c){
                    left = true;
                }
            }
            for(int j=i;j<n;j++){
                if(s[j] == c){
                    right = true;
                }
            }
            if(left && right){
                cnt++
            }
        }
        if(ans < cnt){
            ans = cnt;
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:22: error: expected ';' before '}' token
   25 |                 cnt++
      |                      ^
      |                      ;
   26 |             }
      |             ~
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String s = sc.next();
		int ans = 0;
		for (int i = 1; i < n - 1; i++) {
			int count = 0;
			for (char c = 'a'; c <= 'z'; c++) {
				if (s.substring(0, i).contains(String.valueOf(c)) && s.substring(i).contains(String.valueOf(c))) {
					count++;
				}
			}
			ans = Math.max(ans, count);
		}
		System.out.println(ans);

	}

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

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repm(i, m, n) for (int i = (m); i < (int)(n); i++)
#define all(vec) vec.begin(), vec.end()
using namespace std;

int main(){
  int n;
  string a;
  cin >> n >> a;
  int ans = 0;
  rep(i, 1, n){
    int cnt = 0;
    for (char c = 'a'; c <= 'z'; c++){
      bool l = false, r = false;
      rep(j, i) if (a.at(j) == c) l = true;
      rep(j, i, n) if (a.at(j) == c) r = true;
      if (l && r) cnt++;
    }
    ans = max(ans, cnt);
  }
  cout << ans << endl;
}

Compiler output:
a.cc:12:14: error: macro "rep" passed 3 arguments, but takes just 2
   12 |   rep(i, 1, n){
      |              ^
a.cc:2:9: note: macro "rep" defined here
    2 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |         ^~~
a.cc:17:18: error: macro "rep" passed 3 arguments, but takes just 2
   17 |       rep(j, i, n) if (a.at(j) == c) r = true;
      |                  ^
a.cc:2:9: note: macro "rep" defined here
    2 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:12:3: error: 'rep' was not declared in this scope
   12 |   rep(i, 1, n){
      |   ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(vec) vec.begin(), vec.end()
using namespace std;

int main(){
  int n;
  string a;
  cin >> n >> a;
  int ans = 0;
  rep(i, n - 1){
    int cnt = 0;
    for (char c = 'a'; c < 'A'; c++){
      bool l = false, r = false;
      rep(j, i + 1) if (s.at(j) == c) l = true;
      rep(j, n - i - 1) if (s.at(j + i) == c) r = true;
      if (l && r) cnt++;
    }
    ans = max(ans, cnt);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:25: error: 's' was not declared in this scope
   15 |       rep(j, i + 1) if (s.at(j) == c) l = true;
      |                         ^
a.cc:16:29: error: 's' was not declared in this scope
   16 |       rep(j, n - i - 1) if (s.at(j + i) == c) r = true;
      |                             ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(vec) vec.begin(), vec.end()
using namespace std;

int main(){
  int n;
  string a;
  cin >> n >> a;
  int ans = 0;
  rep(i, n){
    int cnt = 0;
    for (char c = 'a'; c < 'A'; c++){
      bool l = false, r = false;
      rep(j, i) if (s.at(j) == c) l = true;
      rep(j, n - i) if (s.at(j + i) == c) r = true;
      if (l && r) cnt++;
    }
    ans = max(ans, cnt);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: 's' was not declared in this scope
   15 |       rep(j, i) if (s.at(j) == c) l = true;
      |                     ^
a.cc:16:25: error: 's' was not declared in this scope
   16 |       rep(j, n - i) if (s.at(j + i) == c) r = true;
      |                         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  long long int A,B=99,C=1,D=1;
  string S,K,L;
  A=S.size()
  for(int i=1;i<A-1;i++){
    K=S.substr(0,i);
    L=S.substr(i,A-i);
    sort(K.begin(),K.end());
    sort(L.begin(),L.end());
    for(int j=1;j<K.size(),j++){
      if(K[j-1]!=K[j])C++;
    }
    for(int j=1;j<L.size(),j++){
      if(L[j-1]!=L[j])D++;
    }
    B=max(B,min(C,D))
  }
  cout << B << endl;
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: expected ';' before 'for'
    6 |   A=S.size()
      |             ^
      |             ;
    7 |   for(int i=1;i<A-1;i++){
      |   ~~~        
a.cc:7:15: error: 'i' was not declared in this scope
    7 |   for(int i=1;i<A-1;i++){
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,a=0;string s;cin>>n>>s;
  for(int i=1;i<n;i++){
    int c=0;
    for(int j=0;j<26;j++){
      int p=0
      for(int k=0;k<i;k++){
        if(s.at(k)=='a'+j){
          p=1;
          break;
        }
      }
      for(int k=i;k<n;k++){
        if(s.at(k)=='a'+j){
          p++;
          break;
        }
      }
      if(p==2)c++;
    }
    a=max(a,c);
  }
  cout<<a<<endl;
}
    
      
    
    

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

#include <bits/stdc++.h>

#define mod 1000000007

using namespace std;
typedef long long ll; 
 
int main(void){
	
	int N, ans = 0;
	string S;
	
	cin >> N >> S;
	
	for(int i=1; i<N; i++){
		int cnt = 0;
		for(char c = 'a'; c<='z'; c++){
			bool left = false, right = flase;
			for(int j=0; j<i; j++){
				if(s[j] == c)
					left = true;
			}
			for(int j=i; j<N; j++){
				if(s[j] == c)
					right = true;
			}
			if(left && right)
				cnt++;
		}
		ans = max(ans, cnt);
	}
	
	cout << ans;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:52: error: 'flase' was not declared in this scope; did you mean 'fclose'?
   18 |                         bool left = false, right = flase;
      |                                                    ^~~~~
      |                                                    fclose
a.cc:20:36: error: 's' was not declared in this scope
   20 |                                 if(s[j] == c)
      |                                    ^
a.cc:24:36: error: 's' was not declared in this scope
   24 |                                 if(s[j] == c)
      |                                    ^
Language: C++

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

int main()
{
  	int n;
  	string str;
	cin>>n>>str;
  	map<char,int> char_count;
  	int ans=0;
  	for(int i=0 ; i<str.length() ; ++i)
    {
    	char_count[str[i]]=1;
      	map<char,bool> checked;
      	for(int j=i+1 ; j<str.length() ; ++j)
        {
        	if(char_count[str[i]])
            checked[str[i]]=true;
        }
		ans=max(ans,checked.size());
    }
  	cout<<ans<<endl;
  	return 0;
}

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

#include<iostream>
#include<vector>

using namespace std;

int main(){
  int N;
  cin >> N;
  string S;
  cin >> S;
  
  ans = 0;
  for(int i = 0; i < N -1; i++){
    vector<bool> left(24,false);
    vector<bool> right(24,false);
    for(int j = 0; j <= i; j++){
      left[S[j] - 'a'] = true;
    }
    for(int j = i + 1; j < N; j++){
      right[S[j] - 'a'] = true;
    }
    int tmp = 0;
    for(int k = 0; k < 24; k++){
      if(left[k] && right[k]) tmp++;
    }
    ans = max(tmp, ans);
  }
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |   ans = 0;
      |   ^~~
      |   abs
Language: C++

#include <iostream>
#include <string>
using namespace std;
const string alpha = "abcdefghijklmnopqrstuvwxyz";
bool find(string s,int a,int b,int c){
  for(int i = a;i<b;i++){
    if(s[i]==alpha[c]) return true;
  }
  return false;
}
int main(){
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans,tem;
  ans = 0;
  for(int i = 1;i<n-1;i++){
    tem = 0;
    for(int j = 0;j<slpha.size();j++){
      if(find(s,0,i,j) && find(s,i,n,j)) tem++;
    }
    ans = max(ans,tem);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:21: error: 'slpha' was not declared in this scope; did you mean 'alpha'?
   20 |     for(int j = 0;j<slpha.size();j++){
      |                     ^~~~~
      |                     alpha
Language: C++

#include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
using namespace std;
 
template <class T> using V = vector<T>;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 
 
ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
ll combi(ll n,ll m) {
  ll ans=1;
  rFOR(i,n,n-m){
    ans*=i;
  }
  FOR(i,1,m+1){
    ans/=i;
  }
  return ans;
}
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll n;
  	ci(n);
  st s;
  	ci(s)
  ll ans=0;
  FOR(i,0,n-1){
      st a=substr(0,i);
      st b=substr(i+1,n-1);
      vpll A(26);
      FOR(j,0,a.sz){
        ch c=a[j];
        A[c-'a'].fi++;
      }
      FOR(j,0,b.sz){
        ch c=b[j];
        A[c-'a'].se++;
      }
      ll count=0;
      FOR(j,0,26){
        if(A[j].fi!=0&&A[j].se!=0) count++;
      }
    ans=M(ans,count);
  }
  co(ans)
}

Compiler output:
a.cc: In function 'int main()':
a.cc:86:12: error: 'substr' was not declared in this scope; did you mean 'strstr'?
   86 |       st a=substr(0,i);
      |            ^~~~~~
      |            strstr
Language: C++

using namespace std;
#include <bits/stdc++.h>
#define rep(i, s) for (int i = 0; i < s; ++i)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define all(v) (v.begin(), v.end())
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define EPS (1e-7)
#define INF (1e10)
#define PI (acos(-1))
const ll mod = 1000000007;
 
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  string S;
  cin>>N>>S;
  int ans=0;
  FOR(i,1,N){
    for(char s='a';s<='z';s++){
      bool left =false,right=false;
      int cnt=0;
      rep(j,i){
        if(S[j]==s)
          left=true;
      }
      FOR(j,i,N){
        if(S[j]==s)
          right=true;
      }
      if(right&&left)
        cnt++;
    }
    ans=cnt;
  }
  cout<<ans<<endl;
    
    
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:42:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   42 |     ans=cnt;
      |         ^~~
      |         int
Language: C++

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

int main(){
  int n;cin>>n;
  string s;cin>>s;
  
  for(int i=1;i<n-1;i++){
    string s1,s2;
    s1=s.substr(0,i);
    s2=s.substr(i,n-i);
    int c[100]={0};
    int sum_max=0;
    for(int j=0;j<i;j++){
      int a=-1;
      a=s2.find(s1.substr(j,1));
      if(a>=0)c[a]=1;
    }
    int sum=0;
    for(int k=0;k<100;k++){
      sum+=c[k];
    }
    sum_max=max(sum_max,sum);
  }
  cout<<sum_max<<endl;
}

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

#include<iostream>
#include<string>
#include<vector>
#include<set>
#include<algorithm>

using namespace std;

int main(){
  int N; cin >> N ;
   string S; cin >> S; int max_cnt = 0;
  for(int i = 1; i <  ; i++){
    string X, Y; int cnt = 0;
    X = S.substr(0,i);Y = S.substr(i, N - i);
    int alphabet[26] = {0};
    for(int x = 0; x < i; x++){
      alphabet[X[x] - 'a']++;}
    for(int y = i; y < N; y++){
      if(alphabet[Y[y] - 'a'] > 0){ cnt++;}}
    max_cnt = max(max_cnt,cnt);}
    
  
  cout << max_cnt << endl;
   return 0;}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: expected primary-expression before ';' token
   12 |   for(int i = 1; i <  ; i++){
      |                       ^
Language: C++

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

int main(){
    int N;
    cin >> N;
    string S;
    cin >> S;
    
    int ans = 0;
    for(int i = 1;i<N;i++){
        int cnt = 0;

        for(char c = 'a';c<='z';c++){
            bool left = false,right = false;

            for(int j = 0;j<i;j++){
                if(S[j]==c) left = true;
            }
            for(int k = i;k<n;k++){
                if(S[k]==c) right = true;
            }
            
            if(left&&right) cnt++;
        }
        if(ans<cnt) ans = cnt;
    
    }
    printf("%d",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:29: error: 'n' was not declared in this scope
   20 |             for(int k = i;k<n;k++){
      |                             ^
Language: C++

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

int main(){
    int N;
    scanf("%d",&N);
    string S;
    cin >> S;
    
    int ans = 0;
    for(int i = 1;i<N;i++){
        int cnt = 0;

        for(char c = 'a';c<='z';c++){
            bool left = false,right = false;

            for(int j = 0;j<i;j++){
                if(S[j]==c) left = true;
            }
            for(int k = i;k<N;k++){
                if(S[j]==c) right = true;
            }
            
            if(left&&right) cnt++;
        }
        if(ans<cnt) ans = cnt;
    
    }
    printf("%d",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:22: error: 'j' was not declared in this scope
   21 |                 if(S[j]==c) right = true;
      |                      ^
Language: C++

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

int main(){
    int N;
    scanf("%d",&N);
    string S;
    cin >> S;
    
    int ans = 0;
    for(int i = 1;i<N;i++){
        int cnt = 0;

        for(char c = 'a';c<='z';c++){
            bool left = false,right = false;

            for(int j = 0;j<i;j++){
                if(S[j]==c) left = true;
            }
            for(int k = i;k<n;k++){
                if(S[j]==c) right = true;
            }
            
            if(left&&right) cnt++;
        }
        if(ans<cnt) ans = cnt;
    
    }
    printf("%d",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:29: error: 'n' was not declared in this scope
   20 |             for(int k = i;k<n;k++){
      |                             ^
a.cc:21:22: error: 'j' was not declared in this scope
   21 |                 if(S[j]==c) right = true;
      |                      ^
Language: C++

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

int main(){
    int N;
    scanf("%d",&N);
    string S;
    scanf("%s",&S);
    
    int ans = 0;
    for(int i = 1;i<N;i++){
        int cnt = 0;

        for(char c = 'a';c<='z';c++){
            bool left = false,right = false;

            for(int j = 0;j<i;j++){
                if(s[j]==c) left = true;
            }
            for(int k = i;k<n;k++){
                if(s[j]==c) right = true;
            }
            
            if(left&&right) cnt++;
        }
        if(ans<cnt) ans = cnt;
    
    }
    printf("%d",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: 's' was not declared in this scope
   18 |                 if(s[j]==c) left = true;
      |                    ^
a.cc:20:29: error: 'n' was not declared in this scope
   20 |             for(int k = i;k<n;k++){
      |                             ^
a.cc:21:20: error: 's' was not declared in this scope
   21 |                 if(s[j]==c) right = true;
      |                    ^
a.cc:21:22: error: 'j' was not declared in this scope
   21 |                 if(s[j]==c) right = true;
      |                      ^
Language: C++

#include <bits/stdc++.h> 
using namespace std;
 
int main(){
    int N;
    scanf("%d",&N);
    sting S;
    scanf("%s",&S);
    
    int ans = 0;
    for(int i = 1;i<N;i++){
        int cnt = 0;
 
        for(char = 'a';c<='z';c++){
            bool left = false,right = false;
 
            for(int j = 0;j<i;j++){
                if(s[j]==c) left = true;
            }
            for(int k = i;k<n;k++){
                if(s[j]==c) right = true;
            }
            
            if(left&&right) cnt++;
        }
        if(ans<cnt) ans = cnt;
    
    }
    printf("%d",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'sting' was not declared in this scope
    7 |     sting S;
      |     ^~~~~
a.cc:8:17: error: 'S' was not declared in this scope
    8 |     scanf("%s",&S);
      |                 ^
a.cc:14:18: error: expected unqualified-id before '=' token
   14 |         for(char = 'a';c<='z';c++){
      |                  ^
a.cc:14:17: error: expected ';' before '=' token
   14 |         for(char = 'a';c<='z';c++){
      |                 ^~
      |                 ;
a.cc:14:18: error: expected primary-expression before '=' token
   14 |         for(char = 'a';c<='z';c++){
      |                  ^
a.cc:14:24: error: 'c' was not declared in this scope
   14 |         for(char = 'a';c<='z';c++){
      |                        ^
a.cc:14:30: error: expected ')' before ';' token
   14 |         for(char = 'a';c<='z';c++){
      |            ~                 ^
      |                              )
a.cc:14:31: error: 'c' was not declared in this scope
   14 |         for(char = 'a';c<='z';c++){
      |                               ^
Language: C++


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

int main(){
    int N;
    scanf("%d",&N);
    sting S;
    scanf("%s",&S);
    
    int ans = 0;
    for(int i = 1;i<N;i++){
        int cnt = 0;

        for(char = 'a';c<='z';c++){
            bool left = false,right = false;

            for(int j = 0;j<i;j++){
                if(s[j]==c) left = true;
            }
            for(int k = i;k<n;k++){
                if(s[j]==c) right = true;
            }
            
            if(left&&right) cnt++;
        }
        if(ans<cnt) ans = cnt;
    
    }
    printf("%d",ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'sting' was not declared in this scope
    8 |     sting S;
      |     ^~~~~
a.cc:9:17: error: 'S' was not declared in this scope
    9 |     scanf("%s",&S);
      |                 ^
a.cc:15:18: error: expected unqualified-id before '=' token
   15 |         for(char = 'a';c<='z';c++){
      |                  ^
a.cc:15:17: error: expected ';' before '=' token
   15 |         for(char = 'a';c<='z';c++){
      |                 ^~
      |                 ;
a.cc:15:18: error: expected primary-expression before '=' token
   15 |         for(char = 'a';c<='z';c++){
      |                  ^
a.cc:15:24: error: 'c' was not declared in this scope
   15 |         for(char = 'a';c<='z';c++){
      |                        ^
a.cc:15:30: error: expected ')' before ';' token
   15 |         for(char = 'a';c<='z';c++){
      |            ~                 ^
      |                              )
a.cc:15:31: error: 'c' was not declared in this scope
   15 |         for(char = 'a';c<='z';c++){
      |                               ^
Language: C++

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

int main(){
    int N;
    scanf(%d,&N);
    string S;
    scanf(%s,&S);
    
    int ans = 0;
    for(int i = 1;i<N;i++){
        int cnt = 0;

        for(char = 'a';c<='z';c++){
            bool left = false,right = false;

            for(int j = 0;j<i;j++){
                if(s[j]==c) left = true;
            }
            for(int k = i;k<n;k++){
                if(s[j]==c) right = true;
            }
            
            if(left&&right) cnt++;
        }
        if(ans<cnt) ans = cnt;
    
    }
    printf(%d,ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: expected primary-expression before '%' token
    6 |     scanf(%d,&N);
      |           ^
a.cc:6:12: error: 'd' was not declared in this scope
    6 |     scanf(%d,&N);
      |            ^
a.cc:8:11: error: expected primary-expression before '%' token
    8 |     scanf(%s,&S);
      |           ^
a.cc:8:12: error: 's' was not declared in this scope
    8 |     scanf(%s,&S);
      |            ^
a.cc:14:18: error: expected unqualified-id before '=' token
   14 |         for(char = 'a';c<='z';c++){
      |                  ^
a.cc:14:17: error: expected ';' before '=' token
   14 |         for(char = 'a';c<='z';c++){
      |                 ^~
      |                 ;
a.cc:14:18: error: expected primary-expression before '=' token
   14 |         for(char = 'a';c<='z';c++){
      |                  ^
a.cc:14:24: error: 'c' was not declared in this scope
   14 |         for(char = 'a';c<='z';c++){
      |                        ^
a.cc:14:30: error: expected ')' before ';' token
   14 |         for(char = 'a';c<='z';c++){
      |            ~                 ^
      |                              )
a.cc:14:31: error: 'c' was not declared in this scope
   14 |         for(char = 'a';c<='z';c++){
      |                               ^
a.cc:29:12: error: expected primary-expression before '%' token
   29 |     printf(%d,ans);
      |            ^
Language: C++

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

int main(){
    int N;
    scanf("%d",&N);
    sting S;
    scanf("%s",&S);
    
    int ans = 0;
    for(int i = 1;i<N;i++){
        int cnt = 0;

        for(char = 'a';c<='z';c++){
            bool left = false,right = false;

            for(int j = 0;j<i;j++){
                if(s[j]==c) left = true;
            }
            for(int k = i;k<n;k++){
                if(s[j]==c) right = true;
            }
            
            if(left&&right) cnt++;
        }
        if(ans<cnt) ans = cnt;
    
    }
    printf("%d",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'sting' was not declared in this scope
    7 |     sting S;
      |     ^~~~~
a.cc:8:17: error: 'S' was not declared in this scope
    8 |     scanf("%s",&S);
      |                 ^
a.cc:14:18: error: expected unqualified-id before '=' token
   14 |         for(char = 'a';c<='z';c++){
      |                  ^
a.cc:14:17: error: expected ';' before '=' token
   14 |         for(char = 'a';c<='z';c++){
      |                 ^~
      |                 ;
a.cc:14:18: error: expected primary-expression before '=' token
   14 |         for(char = 'a';c<='z';c++){
      |                  ^
a.cc:14:24: error: 'c' was not declared in this scope
   14 |         for(char = 'a';c<='z';c++){
      |                        ^
a.cc:14:30: error: expected ')' before ';' token
   14 |         for(char = 'a';c<='z';c++){
      |            ~                 ^
      |                              )
a.cc:14:31: error: 'c' was not declared in this scope
   14 |         for(char = 'a';c<='z';c++){
      |                               ^
Language: C++

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

int main(){
    int N;
    scanf(%d,&N);
    sting S;
    scanf(%s,&S);
    
    int ans = 0;
    for(int i = 1;i<N;i++){
        int cnt = 0;

        for(char = 'a';c<='z';c++){
            bool left = false,right = false;

            for(int j = 0;j<i;j++){
                if(s[j]==c) left = true;
            }
            for(int k = i;k<n;k++){
                if(s[j]==c) right = true;
            }
            
            if(left&&right) cnt++;
        }
        if(ans<cnt) ans = cnt;
    
    }
    printf(%d,ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: expected primary-expression before '%' token
    6 |     scanf(%d,&N);
      |           ^
a.cc:6:12: error: 'd' was not declared in this scope
    6 |     scanf(%d,&N);
      |            ^
a.cc:7:5: error: 'sting' was not declared in this scope
    7 |     sting S;
      |     ^~~~~
a.cc:8:11: error: expected primary-expression before '%' token
    8 |     scanf(%s,&S);
      |           ^
a.cc:8:12: error: 's' was not declared in this scope
    8 |     scanf(%s,&S);
      |            ^
a.cc:8:15: error: 'S' was not declared in this scope
    8 |     scanf(%s,&S);
      |               ^
a.cc:14:18: error: expected unqualified-id before '=' token
   14 |         for(char = 'a';c<='z';c++){
      |                  ^
a.cc:14:17: error: expected ';' before '=' token
   14 |         for(char = 'a';c<='z';c++){
      |                 ^~
      |                 ;
a.cc:14:18: error: expected primary-expression before '=' token
   14 |         for(char = 'a';c<='z';c++){
      |                  ^
a.cc:14:24: error: 'c' was not declared in this scope
   14 |         for(char = 'a';c<='z';c++){
      |                        ^
a.cc:14:30: error: expected ')' before ';' token
   14 |         for(char = 'a';c<='z';c++){
      |            ~                 ^
      |                              )
a.cc:14:31: error: 'c' was not declared in this scope
   14 |         for(char = 'a';c<='z';c++){
      |                               ^
a.cc:29:12: error: expected primary-expression before '%' token
   29 |     printf(%d,ans);
      |            ^
Language: C++

#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;
string s;
int n;
int main(){
  cin >> n >> s;
  bool used[2][26];
  int ret = 0;
  for(int i=1; i<n; i++){
    int tmp = 0;
    memset(used, false, sizeof(used));
    for(int j=0; j<n; j++){
      if(i<j) used[0][s[j]-'a'] |= true;
      else used[1][s[j]-'a'] |= true;
      }
    for(int j=0; j<26; j++){
      tmp += (used[0][j] & used[1][j])
        }
    ret = max(ret, tmp);
    }
  cout << ret << endl;
  return 0;
  }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:20:39: error: expected ';' before '}' token
   20 |       tmp += (used[0][j] & used[1][j])
      |                                       ^
      |                                       ;
   21 |         }
      |         ~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
string s;
int n;
int main(){
  cin >> n >> s;
  bool used[2][26];
  int ret = 0;
  for(int i=1; i<n; i++){
    int tmp = 0;
    memset(used, false, sizeof(used));
    for(int j=0; j<n; j++){
      if(i<j) used[0][s[j]-'a'] |= true;
      else used[1][s[j]-'a'] |= true;
      }
    for(int j=0; j<26; j++){
      tmp += (used[0][j] & used[1][j])
        }
    ret = max(ret, tmp);
    }
  cout << ret << endl;
  return 0;
  }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'memset' was not declared in this scope
   13 |     memset(used, false, sizeof(used));
      |     ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
a.cc:19:39: error: expected ';' before '}' token
   19 |       tmp += (used[0][j] & used[1][j])
      |                                       ^
      |                                       ;
   20 |         }
      |         ~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
string s;
int n;
int main(){
  cin >> n >> s;
  int ret = 0;
  for(int i=1; i<n-1; i++){
    string a, b;
    int tmp = 0;
    a = s.substr(0, );
    b = s.substr(i);
    for(char ca : a){
      for(char cb : b){
        if(ca == cb){
          tmp ++;
          continue;
          }
        }
      }
      ret = max(ret, tmp);
      }
    cout << ret << endl;
    return 0;
    }

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

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
string s;
int n;
int main(){
  cin >> n >> s;
  int ret = 0;
  for(int i=1; i<n-1; i++){
    string a, b;
    int tmp = 0;
    a = s.substr(i, n-i);
    b = s.substr(i);
    for(char ca : a){
      for(char cb : b){
        if(ca == cb){
          tmp ++;
          continue;
          }
        }
      ret = max(ret, tmp);
      }
    cout << ret << endl;
    return 0;
    }

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

#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <cstdio>
#include <cassert>
using namespace std;

int visited[26];

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

	int n;
	string s;
	cin >> n >> s;
	
	int best = 0;
	for (int i = 0; i < n; i++) {
		memset(visited, sizeof visited, 0);
		for (int j = 0; j <= i; j++) visited[s[j]-'a'] = 1;
		int r = 0;
		for (int j = i+1; j < n; j++) {
			int k = s[j] - 'a';
			if (visited[k] == 1) r++;
			if (visited[k]) visited[k]++;
		}
		best = max(best, r);
	}
	cout << best << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: 'memset' was not declared in this scope
   23 |                 memset(visited, sizeof visited, 0);
      |                 ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <cassert>
  +++ |+#include <cstring>
    9 | using namespace std;