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

#include<iostream>
#include<algorithm>
#include<math.h>
#include<cstdio>
#include<ctype.h>
#include<stdio.h>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<numeric>
#include<string>
typedef long long ll;
using namespace std;

ll gcd(ll a, ll b){
if(a<b){return gcd(b,a);}
else if(a%b){return gcd(b,a%b);}
else{return b;}
}

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'; char 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[i]==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:34:26: error: redeclaration of 'char c'
   34 |     for(char c='a'; char c='z'; c++){
      |                          ^
a.cc:34:14: note: 'char c' previously declared here
   34 |     for(char c='a'; char c='z'; c++){
      |              ^
a.cc:47:19: error: expected '}' at end of input
   47 |   cout<<ans<<endl;
      |                   ^
a.cc:32:25: note: to match this '{'
   32 |   for(int i=1; i<N; ++i){//何文字目に区切りを入れるか
      |                         ^
a.cc:47:19: error: expected '}' at end of input
   47 |   cout<<ans<<endl;
      |                   ^
a.cc:26:11: note: to match this '{'
   26 | int main(){
      |           ^
Language: C

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

int main(){
  int len;
  char s[100];
  int c;
  scanf("%d", &len);
  int p;
  char ls[100];
  char rs[100];
  char matchs[100];
  char ts[2];
  
  p = 1;
  int lp, rp;
  int j;
  
  
  int maxc = 0;
  lp = 1; // ひだりの長さ
  while(lp < len){
  c = 0;
    
    
  
    rp = len-1; // 右のながさ
    
    strcpy(rs, &s[lp+1]);
    
    for(j = 0; j < lp; j++){
      ts[0] = s[j];
      ts[1] = '\0';
    if((strstr(rs,ts) != NULL) && (strstr(matchs, ts) == NULL)){ // 左の文字列があるとき
    
      strcat(matchs, ts);
      c++;
        
    }
    
      if(maxc < c)
        maxc = c;
  lp++;
}
 
    printf("%d\n", c);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:48:1: error: expected declaration or statement at end of input
   48 | }
      | ^
Language: C

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

int main(){
  int len;
  char s[100];
  int c;
  scanf("%d", &len);
  int p;
  char ls[100];
  char rs[100];
  char matchs[100];
  
  
  p = 1;
  int lp, rp;
  int j;
  
  
  int maxc = 0;
  lp = 1; // ひだりの長さ
  while(lp < len){
  c = 0;
    
    
  
    rp = len-1; // 右のながさ
    
    strcpy(rs, &s[lp+1]);
    
    for(j = 0; j < lp; j++){
    if((strstr(rs,s[j]) != NULL) && (strstr(matchs, s[j]) == NULL)){ // 左の文字列があるとき
    
      strcat(matchs, s[j]);
      c++;
        
    }
    
      if(maxc < c)
        maxc = c;
  lp++;
}
 
    printf("%d\n", c);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:32:20: error: passing argument 2 of 'strstr' makes pointer from integer without a cast [-Wint-conversion]
   32 |     if((strstr(rs,s[j]) != NULL) && (strstr(matchs, s[j]) == NULL)){ // 左の文字列があるとき
      |                   ~^~~
      |                    |
      |                    char
In file included from main.c:2:
/usr/include/string.h:350:58: note: expected 'const char *' but argument is of type 'char'
  350 | extern char *strstr (const char *__haystack, const char *__needle)
      |                                              ~~~~~~~~~~~~^~~~~~~~
main.c:32:54: error: passing argument 2 of 'strstr' makes pointer from integer without a cast [-Wint-conversion]
   32 |     if((strstr(rs,s[j]) != NULL) && (strstr(matchs, s[j]) == NULL)){ // 左の文字列があるとき
      |                                                     ~^~~
      |                                                      |
      |                                                      char
/usr/include/string.h:350:58: note: expected 'const char *' but argument is of type 'char'
  350 | extern char *strstr (const char *__haystack, const char *__needle)
      |                                              ~~~~~~~~~~~~^~~~~~~~
main.c:34:23: error: passing argument 2 of 'strcat' makes pointer from integer without a cast [-Wint-conversion]
   34 |       strcat(matchs, s[j]);
      |                      ~^~~
      |                       |
      |                       char
/usr/include/string.h:149:70: note: expected 'const char * restrict' but argument is of type 'char'
  149 | extern char *strcat (char *__restrict __dest, const char *__restrict __src)
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
main.c:46:1: error: expected declaration or statement at end of input
   46 | }
      | ^
Language: C

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

int main(){
  int len;
  char s[100];
  int c;
  scanf("%d", &len);
  int p;
  char ls[100];
  char rs[100];
  char matchs[100];
  
  
  p = 1;
  int lp, rp;
  int j;
  
  
  int maxc = 0;
  lp = 1; // ひだりの長さ
  while(lp < len){
  c = 0;
    
    
  
    rp = len-1; // 右のながさ
    
    strcpy(rs, s[lp+1]);
    
    for(j = 0; j < lp; j++){
    if((strstr(rs,s[j]) != NULL) && (strstr(matchs, s[j]) == NULL)){ // 左の文字列があるとき
    
      strcat(matchs, s[j]);
      c++;
        
    }
    
      if(maxc < c)
        maxc = c;
  lp++;
}
 
    printf("%d\n", c);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:29:17: error: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion]
   29 |     strcpy(rs, s[lp+1]);
      |                ~^~~~~~
      |                 |
      |                 char
In file included from main.c:2:
/usr/include/string.h:141:70: note: expected 'const char * restrict' but argument is of type 'char'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
main.c:32:20: error: passing argument 2 of 'strstr' makes pointer from integer without a cast [-Wint-conversion]
   32 |     if((strstr(rs,s[j]) != NULL) && (strstr(matchs, s[j]) == NULL)){ // 左の文字列があるとき
      |                   ~^~~
      |                    |
      |                    char
/usr/include/string.h:350:58: note: expected 'const char *' but argument is of type 'char'
  350 | extern char *strstr (const char *__haystack, const char *__needle)
      |                                              ~~~~~~~~~~~~^~~~~~~~
main.c:32:54: error: passing argument 2 of 'strstr' makes pointer from integer without a cast [-Wint-conversion]
   32 |     if((strstr(rs,s[j]) != NULL) && (strstr(matchs, s[j]) == NULL)){ // 左の文字列があるとき
      |                                                     ~^~~
      |                                                      |
      |                                                      char
/usr/include/string.h:350:58: note: expected 'const char *' but argument is of type 'char'
  350 | extern char *strstr (const char *__haystack, const char *__needle)
      |                                              ~~~~~~~~~~~~^~~~~~~~
main.c:34:23: error: passing argument 2 of 'strcat' makes pointer from integer without a cast [-Wint-conversion]
   34 |       strcat(matchs, s[j]);
      |                      ~^~~
      |                       |
      |                       char
/usr/include/string.h:149:70: note: expected 'const char * restrict' but argument is of type 'char'
  149 | extern char *strcat (char *__restrict __dest, const char *__restrict __src)
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
main.c:46:1: error: expected declaration or statement at end of input
   46 | }
      | ^
Language: C

#include<stdio.h>

int main() {
  int N;
  char S[100] = {'\0'};
  int right[26] = {0};
  int left[26] = {0};
  int i, j;
  int max = 0;
  int num_tmp;
  
  scanf("%d", &N);
  scanf("%s", S);
  
  for (i = 0; i < N; i++) {
    num_tmp = 0;
    for (j = 0; j < 26++) {
      right[j] = 0;
      left[j] = 0;
    }
    for (j = 0; j < i; j++) {
      right[ S[j] - 'a' ] = 1;
    }
    for (j = i; j < N; j++) {
      left[ S[j] - 'a' ] = 1;
    }
    for (j = 0; j < N; j++) {
      if (right[j] == 1 && left[j] == 1) {
        num_tmp += 1;
      }
    }
    
    if (max < num_tmp) {
      max = num_tmp;
    }
  }
  
  printf("%d\n", max);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:23: error: lvalue required as increment operand
   17 |     for (j = 0; j < 26++) {
      |                       ^~
main.c:17:25: error: expected ';' before ')' token
   17 |     for (j = 0; j < 26++) {
      |                         ^
      |                         ;
Language: C++

int main(){
  int n,maxans = 0,count = 0;
  string str;
  bool alph[26] = {};
  
  cin >> n >> str;
  for(int right = 0; right < n-1 ;right++){
    for(int i = 0; i <= right ; i++){
      alph[str[i] - 'a'] = true;
    }
    for(int j = right + 1; j < n ; j++){
      if(alph[str[j] - 'a']){
	count ++;
	alph[str[j] - 'a'] = false;
      }
      
    }
    maxans = max(maxans,count);
    count = 0;
  }
 
  cout << maxans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'string' was not declared in this scope
    3 |   string str;
      |   ^~~~~~
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> n >> str;
      |   ^~~
a.cc:6:15: error: 'str' was not declared in this scope; did you mean 'std'?
    6 |   cin >> n >> str;
      |               ^~~
      |               std
a.cc:18:14: error: 'max' was not declared in this scope
   18 |     maxans = max(maxans,count);
      |              ^~~
a.cc:22:3: error: 'cout' was not declared in this scope; did you mean 'count'?
   22 |   cout << maxans << endl;
      |   ^~~~
      |   count
a.cc:22:21: error: 'endl' was not declared in this scope
   22 |   cout << maxans << endl;
      |                     ^~~~
Language: C++

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

int main(){
  int n,maxans = 0,count = 0;
  string str;
  bool alph[26] = {};
  
  cin >> n >> str;
  for(int right = 0; right < n-1 ;right++){
    for(int i = 0; i <= right ; i++){
      alph[str[i] - 'a'] = true;
    }
    for(int j = right + 1; j < n ; j++){
      if(alph[str[j] - 'a']){
        count ++;
        alph[str[j] - 'a'] = false;
      }
      
    }
    maxans = max(maxans,count);
    count = ;
  }
 
  cout << maxans << endl;

  return 0;
}


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

#include<cstdio>
#include<bits/stdc++.h>
using namespace std;
const int maxn=105;
char str[maxn];
int main(){
	int n;
	scanf("%d",&n);
	getchar();
	gets(str);
	int sum=0;
	for(int cut=1;cut<n;cut++){
		int a[26]={0},ans=0;
		for(int i=0;i<cut;i++){
			if(a[str[i]-'a']==1)continue;
			for(int j=cut;j<n;j++){
				if(str[i]==str[j]&&a[str[i]-'a']==0){
					ans++;
					a[str[i]-'a']=1;
				}
			}
		}
		sum=max(sum,ans);
	}
	printf("%d\n",sum);
	return 0;
}

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

# include "iostream"
# include "cstdio"
# include "cstdio" 

using namespace std;

const int maxm=100+10; 
bool  
	f[maxm],
	q[maxm]; 

int main(){
	int n,
		now,
		ans;
	register int i,j;
	char s[maxm]; 
	scanf("%d",&n);
	cin>>s; 
	for(i=0;i<n;i++){
		f[s[i]-'a']=true; 
		memset(q,0,sizeof(q));
		for(j=i+1;j<n;j++){
			q[s[j]-'a']=true;  
		}
		now=0;
		for(j=0;j<26;j++){
			if(q[j] && f[j]){
				now++; 
			} 
		} 
		ans=max(ans,now); 
	}
	printf("%d",ans); 
	return 0; 
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   16 |         register int i,j;
      |                      ^
a.cc:16:24: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   16 |         register int i,j;
      |                        ^
a.cc:22:17: error: 'memset' was not declared in this scope
   22 |                 memset(q,0,sizeof(q));
      |                 ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | # include "cstdio"
  +++ |+#include <cstring>
    4 |
Language: C++

#include<bits/stdc++.h>
using namespace std; 
int main(){
  int l,i,j,b[256]={0},n,r=0;
  char s[256];
  scanf("%d%s",&l,s);
  for(i=1;i<l-1;i++)
  {
    for(j='a';j<='z';j++)
	{
		b[j]=0;
	}
    for(j=0;j<i;j++)
	{
		b[s[j]]=1;
	}
    n=0;
    for(j=i;j<l;j++)
	{
		if(b[s[j]])
		{
			b[s[j]]=0;
			n++;
		}
	}
    r=max(r,n);
  }
  printf("%d\n",r);
  return 0;
}j

Compiler output:
a.cc:30:2: error: 'j' does not name a type
   30 | }j
      |  ^
Language: C++

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

using namespace std;

vector<int> calc(string &s) {
  vector<int> ret(256, 0);
  for(int i = 0; i < s.size(); i++) {
  	ret[s[i]] = 1;
  }
  return ret;
}

int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int ret = 0;
  for(int i = 0; i < S.size(); i++) {
  	string s1 = S.substr(0, i);
    string s2 = S.substr(i, n - i);
    vector<int> b1 = calc(s1);
    vector<int> b2 = calc(s2);
    int k = 0;
    for(int j = 0; j < 256; j++) {
    	k += b1[j] * b2[j];
    }
    ret = max(ret, k);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:29: error: 'n' was not declared in this scope
   24 |     string s2 = S.substr(i, n - i);
      |                             ^
Language: Java

import java.util.Scanner;
import java.util.Arrays;
import java.util.Set;
import java.util.HashSet;
public class Main2{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        int max = 0;
        for(int i = 0;i < s.length();i++){
            Set<Character> first = new HashSet<Character>(); 
            Set<Character> last = new HashSet<Character>(); 
            for(int j = 0;j <= i;j++){
                first.add(s.charAt(j));
            }
            for(int j = i+1;j < s.length();j++){
                last.add(s.charAt(j));
            }
            int cnt = 0;
            for(Character key : first){
                if(last.contains(key)){
                    cnt++;
                }
            }
            max = Math.max(max,cnt);
        }
        System.out.println(max);

    }
}


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

#include<stdio.h>

int main(){

int n,a[200],i,k,cnt,max=-1;
scanf(“%d”,&n);
for(i=0;i<n;i++)scanf(“%d”,&a[i]);

for(i=0;i<n;i++){cnt=0
for(k=0;k<n-i;k++){
if(a[i]==a[i+k]){
cnt++;
break;
}
if(cnt>max)max=cnt;
}
printf(“%d¥n”,max);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:7: error: stray '\342' in program
    6 | scanf(<U+201C>%d<U+201D>,&n);
      |       ^~~~~~~~
main.c:6:8: error: expected expression before '%' token
    6 | scanf(“%d”,&n);
      |        ^
main.c:6:10: error: stray '\342' in program
    6 | scanf(<U+201C>%d<U+201D>,&n);
      |                 ^~~~~~~~
main.c:7:23: error: stray '\342' in program
    7 | for(i=0;i<n;i++)scanf(<U+201C>%d<U+201D>,&a[i]);
      |                       ^~~~~~~~
main.c:7:24: error: expected expression before '%' token
    7 | for(i=0;i<n;i++)scanf(“%d”,&a[i]);
      |                        ^
main.c:7:26: error: stray '\342' in program
    7 | for(i=0;i<n;i++)scanf(<U+201C>%d<U+201D>,&a[i]);
      |                                 ^~~~~~~~
main.c:9:23: error: expected ';' before 'for'
    9 | for(i=0;i<n;i++){cnt=0
      |                       ^
      |                       ;
   10 | for(k=0;k<n-i;k++){
      | ~~~                    
main.c:17:8: error: stray '\342' in program
   17 | printf(<U+201C>%d<U+00A5>n<U+201D>,max);
      |        ^~~~~~~~
main.c:17:11: error: stray '\302' in program
   17 | printf(<U+201C>%d<U+00A5>n<U+201D>,max);
      |                  ^~~~~~~~
main.c:17:13: error: stray '\342' in program
   17 | printf(<U+201C>%d<U+00A5>n<U+201D>,max);
      |                           ^~~~~~~~
main.c:19:1: error: expected declaration or statement at end of input
   19 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int dif(string a, string b){
	int diff = 0;
	set <char> s1, s2;

	for(int i = 0; i < a.size(); i++)
		s1.insert(a[i]);

	for(int i = 0; i < b.size(); i++)
		s2.insert(b[i]);

	for(const char &c : s1)
		if (s2.find(c) != s2.end())
			dif++;

	return diff;
}

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

	int n;
	string s;

	cin >> n >> s;

	int max_dif = -1;
	for(int i = 1; i < n - 1; i++){
		string s1 = s.substr(0, i);
		string s2 = s.substr(i, n - i);
		max_dif = max(max_dif, dif(s1, s2));
	}

	printf("%d\n", max_dif);
}

Compiler output:
a.cc: In function 'int dif(std::string, std::string)':
a.cc:17:25: warning: ISO C++ forbids incrementing a pointer of type 'int (*)(std::string, std::string)' {aka 'int (*)(std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>)'} [-Wpointer-arith]
   17 |                         dif++;
      |                         ^~~
a.cc:17:28: error: lvalue required as increment operand
   17 |                         dif++;
      |                            ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, hozon, ans = 0;
  string s,o,t;
  bool one = false, two = false;
  cin >> n;
  cin >> s;
  for(int i = 0; i < n; i++){
    o = s.substr(0, i);
    t = s.substr(i);
    for(int j = 0; j < o.size(); j++){
      one = false;
      two = false;
      hozon = 0;
      for(char c = 'a'; c <= 'z'; c++){
        if(o[i] == c){
          one = true;
          for(int k = 0; k < t.size(); k++){
            if(t[j] == c) two = true;
            if(one == true && two == true){
              hozon++;
          }
        ans = max(ans, hozon);
      }
        }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:9:29: note: to match this '{'
    9 |   for(int i = 0; i < n; i++){
      |                             ^
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, hozon, ans = 0;
  string s,o,t;
  bool one = false, two = false;
  cin >> n;
  cin >> s;
  for(int i = 0; i < n; i++){
    o = s.substr(0, i);
    t = s.substr(i);
    for(int j = 0; j < o.size(); j++){
      one = false;
      two = false;
      hozon = 0;
      for(char c = 'a'; c <= 'z'; c++){
        if(o[i] == c){
          one = true;
          for(int k = 0; k < t.size(); k++){
            if(t[j] == c) two = true;
            if(one == true && two == true){
              hozon++;
          }
        ans = max(ans, hozon);
      }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:2: error: expected '}' at end of input
   29 | }
      |  ^
a.cc:12:38: note: to match this '{'
   12 |     for(int j = 0; j < o.size(); j++){
      |                                      ^
a.cc:29:2: error: expected '}' at end of input
   29 | }
      |  ^
a.cc:9:29: note: to match this '{'
    9 |   for(int i = 0; i < n; i++){
      |                             ^
a.cc:29:2: error: expected '}' at end of input
   29 | }
      |  ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, hozon, ans = 0;
  string s,o,t;
  bool one = false, two = false;
  cin >> n;
  cin >> s;
  for(int i = 0; i < n; i++){
    o = s.substr(0, i);
    t = s.substr(i);
    for(int j = 0; j < o.size(); j++){
      one = false;
      two = false;
      hozon = 0;
      for(char c = 'a'; c <= 'z'; c++){
        if(o[i] == c){
          one = true;
          for(int k = 0; k < t.size(); k++){
            if(t[j] == c) two = true;
            if(one == true && two == true){
              hozon++;
          }
        ans = max(ans, hozon);
      }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:16:39: note: to match this '{'
   16 |       for(char c = 'a'; c <= 'z'; c++){
      |                                       ^
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:12:38: note: to match this '{'
   12 |     for(int j = 0; j < o.size(); j++){
      |                                      ^
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:9:29: note: to match this '{'
    9 |   for(int i = 0; i < n; i++){
      |                             ^
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

#include<stdio.h>
#include <iostream>
#include <algorithm>
#include<string.h>
#includ#include<stdio.h>
#include <iostream>
#include <algorithm>
#include<string.h>
#include<math.h>

using namespace std;



int a[30], ax = 0;
int b[30], bx = 0;
char cs[105];
int  main()
{
	int n;
    char c;
	while(scanf("%d",&n)!=EOF)
	{
		memset(a, 0, sizeof(a));
		memset(b, 0, sizeof(b));
		ax = 0;
		bx = 0;


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

			cin>>c;
			cs[i] = c;
			if (b[c - 'a'] == 0)
			{
				bx++;
			}
			b[c - 'a']++;
		}
		int maxx = -1;
		for (int i = 0; i < n - 1; i++)
		{
			b[cs[i] - 'a']--;
			if (a[cs[i] - 'a'] == 0)ax++;
			if (b[cs[i] - 'a'] == 0)
			{
				ax--;
				if (ax < 0)ax = 0;
			}
			a[cs[i] - 'a']++;

			maxx = max(maxx, ax);
		}

		printf("%d", maxx);
	}
	return 0;
}

Compiler output:
a.cc:5:2: error: invalid preprocessing directive #includ; did you mean #include?
    5 | #includ#include<stdio.h>
      |  ^~~~~~
      |  include
Language: C

#include <stdio.h>
int main(){

  int N, i, j, k, count, max;
  char S[N], X[N], Y[N];
  char alp[] = {abcdefghijklmnopqrstuvwxyz};
  int alpnum[26];

  count = 0; max = 0;

  scanf("%d", &N);
  scanf("%s", S);

  if(N < 2) return(-1);

  for(i=0; i<26; i++){
    alpnum[j] = 0;
  }

  for(i=0; i<N; i++){
    for(j=0; j<=i; j++){
      X[j] = S[j];
    }
    for(j=i; j<N; j++){
      Y[j] = S[j];
    }

    for(j=0; j<26; j++){
      for(k=0; k<26; k++){
        if(X[j] == alp[k] || alpnum[k] == 0)
          alpnum[k] = 1;
      }
    }

    for(j=0; j<26; j++){
      for(k=0; k<26; k++){
        if(Y[j] == alp[k] || alpnum[k] == 1)
          alpnum[k] = 2;
      }
    }

    for(j=0; j<26; j++){
      if(alpnum[j] == 2)
        count++;
    }

    if(max < count)
      max = count;
  }

  printf("%d", count);
}

Compiler output:
main.c: In function 'main':
main.c:6:17: error: 'abcdefghijklmnopqrstuvwxyz' undeclared (first use in this function)
    6 |   char alp[] = {abcdefghijklmnopqrstuvwxyz};
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:6:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<stdio.h>
#include <iostream>
#include <algorithm>
#include<string.h>
#includ#include<stdio.h>
#include <iostream>
#include <algorithm>
#include<string.h>
#include<math.h>

using namespace std;



int a[30], ax = 0;
int b[30], bx = 0;
char cs[105];
int  main()
{
	int n;
    char c;
	while(scanf("%d",&n)!=EOF)
	{
		memset(a, 0, sizeof(a));
		memset(b, 0, sizeof(b));
		ax = 0;
		bx = 0;


		for (int i = 0; i < n; i++)
		{
            getchar();
			scanf("%c",&c);
			cs[i] = c;
			if (b[c - 'a'] == 0)
			{
				bx++;
			}
			b[c - 'a']++;
		}
		int maxx = -1;
		for (int i = 0; i < n - 1; i++)
		{
			b[cs[i] - 'a']--;
			if (a[cs[i] - 'a'] == 0)ax++;
			if (b[cs[i] - 'a'] == 0)
			{
				ax--;
				if (ax < 0)ax = 0;
			}
			a[cs[i] - 'a']++;

			maxx = max(maxx, ax);
		}

		printf("%d", maxx);
	}
	return 0;
}

Compiler output:
a.cc:5:2: error: invalid preprocessing directive #includ; did you mean #include?
    5 | #includ#include<stdio.h>
      |  ^~~~~~
      |  include
Language: C++

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

#define CEK(x) cerr << "The value of " << #x << " is " << x << endl
#define endl '\n'
using graphInt = vector<vector< int> >;
using graphStr = map<string, vector<string> > ;


int getSame(map<char,int>a, map<char,int>b){
	int res = 0;
	using mapIt = map<char,int>::iterator;
	for (mapIt itA = a.begin(); itA!=a.end(); itA++){
		for (mapIt itB = b.begin(); itB!=b.end(); itB++){
			if (itA->first==itB->first){
				++res;
				break;
			}
		}
	}
	return res;
}

string s;
int n;
int main(){
	cin >> n >>  s;
	int res = 1;
	for (int i=0; i<(int)s.size(); i++){
		map<char, int> a,b;
		int tmp=0;
		for (char cur = 'a'; cur<='z'; cur++){
			for (int j=0; j<i; j++){
				if (cur==s[j]){
					++tmp;
					break;
				}
			}
			for (int j=i; j<(int)s.size(); j++){
				if (cur==s[j]){
					++tmp;	
					break;
				}
			}
		}
		if (tmp>res) res=val;
	}
	cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:34: error: 'val' was not declared in this scope
   46 |                 if (tmp>res) res=val;
      |                                  ^~~
Language: C++

#include<iostream>
using namespace std;

int count(int n,int i,char* str);

int main()
{
  int n,ans;
  char str[100];
  cin>>n;
  cin>>str;

  ans = 0:
  
  for(int i = 0 ; i <= n-1 ; i++)
  {
    if(ans < count(n,i,str))
    {
      ans = count(n,i,str);
    }
  }
  
  cout<<ans<<endl;
  
  return 0;
}

int count(int n,int i,char* str)
{
  int num = 0;
  
  for(int j = 0 ; j <= i-1 ; j++)
  {
    for(int k = i ; k <= n ; k++)
    {
      if(str[j] == str[k])
      {
        num++;
        k=n+1;
      }
    }
  }  
  return num;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: expected ';' before ':' token
   13 |   ans = 0:
      |          ^
      |          ;
a.cc:15:19: error: 'i' was not declared in this scope
   15 |   for(int i = 0 ; i <= n-1 ; i++)
      |                   ^
Language: C++

#include<iostream>
using namespace std;

int count(int n,int i,char[] str);

int main()
{
  int n,ans;
  char str[100];
  cin>>n;
  cin>>str;
  
  for(int i = 0 ; i <= n-1 ; i++)
  {
    if(ans < count(n,i,str))
    {
      ans = count(n,i,str);
    }
  }
  
  cout<<ans<<endl;
  
  return 0;
}

int count(int n,int i,char[] str)
{
  int num = 0;
  
  for(int j = 0 ; j <= i-1 ; j++)
  {
    for(int k = i ; k <= n ; k++)
    {
      if(str[j] == str[k])
      {
        num++;
        k=n;
      }
    }
  }  
  return num;
}

Compiler output:
a.cc:4:30: error: expected ',' or '...' before 'str'
    4 | int count(int n,int i,char[] str);
      |                              ^~~
a.cc:26:30: error: expected ',' or '...' before 'str'
   26 | int count(int n,int i,char[] str)
      |                              ^~~
a.cc: In function 'int count(int, int, char*)':
a.cc:34:10: error: 'str' was not declared in this scope; did you mean 'std'?
   34 |       if(str[j] == str[k])
      |          ^~~
      |          std
Language: C++

#include<iostream>
using namespace std;

int count(int n,int i,char[] a);

int main()
{
  int n,ans;
  char str[100];
  cin>>n;
  cin>>str;
  
  for(int i = 0 ; i <= n-1 ; i++)
  {
    if(ans < count(n,i,str))
    {
      ans = count(n,i,str);
    }
  }
  
  cout<<ans<<endl;
  
  return 0;
}

int count(int n,int i,char[] str)
{
  int num = 0;
  
  for(int j = 0 ; j <= i-1 ; j++)
  {
    for(int k = i ; k <= n ; k++)
    {
      if(str[j] == str[k])
      {
        num++;
        k=n;
      }
    }
  }  
  return num;
}

Compiler output:
a.cc:4:30: error: expected ',' or '...' before 'a'
    4 | int count(int n,int i,char[] a);
      |                              ^
a.cc:26:30: error: expected ',' or '...' before 'str'
   26 | int count(int n,int i,char[] str)
      |                              ^~~
a.cc: In function 'int count(int, int, char*)':
a.cc:34:10: error: 'str' was not declared in this scope; did you mean 'std'?
   34 |       if(str[j] == str[k])
      |          ^~~
      |          std
Language: C++

#include<iostream>
using namespace std;

int count(int n,int i,char a);

int main()
{
  int n,ans;
  char str[100];
  cin>>n;
  cin>>str;
  
  for(int i = 0 ; i <= n-1 ; i++)
  {
    if(ans < count(n,i,str))
    {
      ans = count(n,i,str);
    }
  }
  
  cout<<ans<<endl;
  
  return 0;
}

int count(int n,int i,char str)
{
  int num = 0;
  char[n] a = str;
  for(int j = 0 ; j <= i-1 ; j++)
  {
    for(int k = i ; k <= n ; k++)
    {
      if(a[j] == a[k])
      {
        num++;
        k=n;
      }
    }
  }  
  return num;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: invalid conversion from 'char*' to 'char' [-fpermissive]
   15 |     if(ans < count(n,i,str))
      |                        ^~~
      |                        |
      |                        char*
a.cc:4:28: note:   initializing argument 3 of 'int count(int, int, char)'
    4 | int count(int n,int i,char a);
      |                       ~~~~~^
a.cc:17:23: error: invalid conversion from 'char*' to 'char' [-fpermissive]
   17 |       ans = count(n,i,str);
      |                       ^~~
      |                       |
      |                       char*
a.cc:4:28: note:   initializing argument 3 of 'int count(int, int, char)'
    4 | int count(int n,int i,char a);
      |                       ~~~~~^
a.cc: In function 'int count(int, int, char)':
a.cc:29:7: error: structured binding declaration cannot have type 'char'
   29 |   char[n] a = str;
      |       ^~~
a.cc:29:7: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:29:8: error: declaration of 'auto n' shadows a parameter
   29 |   char[n] a = str;
      |        ^
a.cc:26:15: note: 'int n' previously declared here
   26 | int count(int n,int i,char str)
      |           ~~~~^
a.cc:29:11: error: expected initializer before 'a'
   29 |   char[n] a = str;
      |           ^
a.cc:29:11: error: expected ';' before 'a'
a.cc:34:10: error: 'a' was not declared in this scope
   34 |       if(a[j] == a[k])
      |          ^
Language: C++

#include<iostream>
using namespace std;

int count(int n,int i,char a)

int main()
{
  int n,ans;
  char str[100];
  cin>>n;
  cin>>str;
  
  for(int i = 0 ; i <= n-1 ; i++)
  {
    if(ans < count(n,i,str))
    {
      ans = count(n,i,str);
    }
  }
  
  cout<<ans<<endl;
  
  return 0;
}

int count(int n,int i,char str)
{
  int num = 0;
  char[n] a = str;
  for(int j = 0 ; j <= i-1 ; j++)
  {
    for(int k = i ; k <= n ; k++)
    {
      if(a[j] == a[k])
      {
        num++;
        k=n;
      }
    }
  }  
  return num;
}

Compiler output:
a.cc:6:1: error: expected initializer before 'int'
    6 | int main()
      | ^~~
a.cc: In function 'int count(int, int, char)':
a.cc:29:7: error: structured binding declaration cannot have type 'char'
   29 |   char[n] a = str;
      |       ^~~
a.cc:29:7: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:29:8: error: declaration of 'auto n' shadows a parameter
   29 |   char[n] a = str;
      |        ^
a.cc:26:15: note: 'int n' previously declared here
   26 | int count(int n,int i,char str)
      |           ~~~~^
a.cc:29:11: error: expected initializer before 'a'
   29 |   char[n] a = str;
      |           ^
a.cc:29:11: error: expected ';' before 'a'
a.cc:34:10: error: 'a' was not declared in this scope
   34 |       if(a[j] == a[k])
      |          ^
Language: C++

#include<iostream>
using namespace std;

int main()
{
  int n,ans;
  char str[100];
  cin>>n;
  cin>>str;
  
  for(int i = 0 ; i <= n-1 ; i++)
  {
    if(ans < count(n,i,str))
    {
      ans = count(n,i,str);
    }
  }
  
  cout<<ans<<endl;
  
  return 0;
}

int count(int n,int i,char a)
{
  int num = 0;

  for(int j = 0 ; j <= i-1 ; j++)
  {
    for(int k = i ; k <= n ; k++)
    {
      if(a[j] == a[k])
      {
        num++;
        k=n;
      }
    }
  }  
  return num;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'count' was not declared in this scope
   13 |     if(ans < count(n,i,str))
      |              ^~~~~
a.cc: In function 'int count(int, int, char)':
a.cc:32:11: error: invalid types 'char[int]' for array subscript
   32 |       if(a[j] == a[k])
      |           ^
a.cc:32:19: error: invalid types 'char[int]' for array subscript
   32 |       if(a[j] == a[k])
      |                   ^
Language: C++

#include<iostream>
using namespace std;

int count(int n,int i,char str)
{
  int num = 0;

  for(int j = 0 ; j <= i-1 ; j++)
  {
    for(int k = i ; k <= n ; k++)
    {
      if(str[j] == str[k])
      {
        num++;
        k=n;
      }
    }
  }  
  return num;
}

int main()
{
  int n,ans;
  char str[100];
  cin>>n;
  cin>>str;
  
  for(int i = 0 ; i <= n-1 ; i++)
  {

  }
  
  cout<<ans<<endl;
  
  return 0;
}



Compiler output:
a.cc: In function 'int count(int, int, char)':
a.cc:12:13: error: invalid types 'char[int]' for array subscript
   12 |       if(str[j] == str[k])
      |             ^
a.cc:12:23: error: invalid types 'char[int]' for array subscript
   12 |       if(str[j] == str[k])
      |                       ^
Language: C++

#include<iostream>
using namespace std;

int main()
{
  int n,ans;
  char str[100];
  cin>>n;
  cin>>str;
  
  for(int i = 0 ; i <= n-1 ; i++)
  {

  }
  
  cout<<ans<<endl;
  
  return 0;
}

public int count(int n,int i,char str)
{
  int num = 0;

  for(int j = 0 ; j <= i-1 ; j++)
  {
    for(int k = i ; k <= n ; k++)
    {
      if(str[j] == str[k])
      {
        num++;
        k=n;
      }
    }
  }  
  return num;
}

Compiler output:
a.cc:21:1: error: expected unqualified-id before 'public'
   21 | public int count(int n,int i,char str)
      | ^~~~~~
Language: C++

#include<iostream>
using namespace std;

int main()
{
  int n,ans;
  char str[100];
  cin>>n;
  cin>>str;
  
  for(int i = 0 ; i <= n-1 ; i++)
  {
    if(ans < count(n,i,str))
    {
      ans = count(n,i,str);
    }
  }
  
  cout<<ans<<endl;
  
  return 0;
}

int count(int n,int i,char str)
{
  int num = 0;

  for(int j = 0 ; j <= i-1 ; j++)
  {
    for(int k = i ; k <= n ; k++)
    {
      if(str[j] == str[k])
      {
        num++;
        k=n;
      }
    }
  }  
  return num;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'count' was not declared in this scope
   13 |     if(ans < count(n,i,str))
      |              ^~~~~
a.cc: In function 'int count(int, int, char)':
a.cc:32:13: error: invalid types 'char[int]' for array subscript
   32 |       if(str[j] == str[k])
      |             ^
a.cc:32:23: error: invalid types 'char[int]' for array subscript
   32 |       if(str[j] == str[k])
      |                       ^
Language: C++

int main() {

	int n;
	cin >> n;

	char s[128];
	cin >> s;
	int count[128] = {0};

	char *xx = s;
	char *yy = &s[2];

	int max = 0;

	for (int i = 1; i < n; i++) {
		char *x = s;
		char *y = &s[i];
		
		int bag[26] = {0};
		
		for (int j = 0; j < i; j++) {
			bag[x[j]-'a']=1;
			
		}

		for (int j = i; j < n; j++) {
			bag[x[j] -'a']++;
			
		}
		for (int j = 0; j < 26; j++) {
			if (bag[j] > 1)count[i]++;
		}
		if (max < count[i])max = count[i];
	}
	//int max = 0;
	
	//max = maxx(n,count);

	printf("%d", max);
		return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> n;
      |         ^~~
a.cc:39:9: error: 'printf' was not declared in this scope
   39 |         printf("%d", max);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main() {
Language: C++

#include <cstdio>
#include <algorithm>
using namespace std;
 
int main() {
    int n;
    scanf("%d", &n);
 
    char c[n];
    scanf("%s", c);
 
    int left[26], right[26];    // 左右それぞれの各文字の個数
    for (int i = 0; i < 26; i++) {
        left[i] = right[i] = 0;
    }
 
    for (int i = 0; i < n; i++) {
        int index = c[i] - 'a';
        right[index]++;
    }
 
    int numCommon = 0, ans = 0;
    for (int i = 0; i < n; i++) {   // 切断位置をiとi+1の間とする
        int index = c[i] - 'a';
        right[index]--;
        if (left[index] == 0 && right[index] > 0) { // 左が0→1, 右がk+1→k(k>0)のとき共通の文字が増加
            numCommon++;
            ans = max(ans, numCommon);
        } else if (left[index] > 0 && right[index] == 0) {  // 左がk→k+1(k>0), 右が1→0のとき減少
            numCommon--;
        }
        left[index]++;
    }
 
    printf("%d\n", ans);
    return 0;
}
#include <cstdio>
#include <algorithm>
using namespace std;

int main() {
    int n;
    scanf("%d", &n);

    char c[n];
    scanf("%s", c);

    int left[26], right[26];    // 左右それぞれの各文字の個数
    for (int i = 0; i < 26; i++) {
        left[i] = right[i] = 0;
    }

    for (int i = 0; i < n; i++) {
        int index = c[i] - 'a';
        right[index]++;
    }

    int numCommon = 0, ans = 0;
    for (int i = 0; i < n; i++) {   // 切断位置をiとi+1の間とする
        int index = c[i] - 'a';
        right[index]--;
        if (left[index] == 0 && right[index] > 0) { // 左が0→1, 右がk+1→k(k>0)のとき共通の文字が増加
            numCommon++;
            ans = max(ans, numCommon);
        } else if (left[index] > 0 && right[index] == 0) {  // 左がk→k+1(k>0), 右が1→0のとき減少
            numCommon--;
        }
        left[index]++;
    }

    printf("%d\n", ans);
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vs = vector<string>;
#define  rep(i,n) for(ll i = 0; i < (n); ++i)
#define  red(i,n) for(ll i = (n)-1; i >= 0; --i)
#define  all(a)   begin(a),end(a)
#define  pb(a)    push_back(a)
#define  yn(a)    cout << ( (a)?"Yes\n":"No\n" );
inline ll gcd(ll a,ll b) { return b?gcd(b,a%b):a; }
const ll INF = 1e9+9, LINF = 1e18;


int main()
{
    int n,ans=0;
    char c;
    cin>>n;
    vector<vi> s(26);
    rep(i,n) cin>>c,s[c-'a'].pb(i);
    rep(i,n-1){
        int sum=0;
        rep(j,26){
            bool a=0,b=0;
            for(auto x:s[j])if(x<=i)a=1;else b=1;
            if(a&&b)sum++;
        }
        ans=max(ans,sum);
    }
    cout<<ans<<endl;

    return 0;
}


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

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

//入力：重複あり文字出力：重複なし文字
string fun(string x){
    std::vector<string> v;
    // v に値を設定する
    std::sort(v.begin(), v.end());
    return v.erase(std::unique(v.begin(), v.end()), v.end());
}

int main(void){
    int n,i,x,y;
    string s;
    cin >> n;
    cin >> s;
    for(i=1;i<n;i++){
        //cout << s.at(i);
        //cout << i << endl;
        //共通文字の探索
        //X=探索文字の番号
        for(x=1;x<=i;x++){
            for(y=i+1;y<=n;y++){
                if(s.at(x)==s.at(y)){
                    count++;
                }
            }
        }

    }
    cout << endl;
    return 0;
}

Compiler output:
a.cc: In function 'std::string fun(std::string)':
a.cc:9:19: error: could not convert 'v.std::vector<std::__cxx11::basic_string<char> >::erase(__gnu_cxx::__normal_iterator<const std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >(std::unique<__gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > > >(v.std::vector<std::__cxx11::basic_string<char> >::begin(), v.std::vector<std::__cxx11::basic_string<char> >::end())), __gnu_cxx::__normal_iterator<const std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >(v.std::vector<std::__cxx11::basic_string<char> >::end()))' from 'std::vector<std::__cxx11::basic_string<char> >::iterator' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
    9 |     return v.erase(std::unique(v.begin(), v.end()), v.end());
      |            ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   std::vector<std::__cxx11::basic_string<char> >::iterator
a.cc: In function 'int main()':
a.cc:25:26: error: no post-increment operator for type
   25 |                     count++;
      |                          ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  string S;
  int ans[200]={0};
  cin>>N>>S;
  for(int i=0;i<N;i++)
  {
    set<char> L,R;
    for(int k=0;k<=i;k++)
    {
      R.insert(S[k]);
    }
    for(int u=i+1;u<N;u++)
    {
      L.insert(S[u]);
    }
    for(int h=0;h<N-i;h++)
    {
      if(L.find(R[h])==L.end())
      {
        ans[i]=ans[i]+1;
      }
    }
  }
  sort(ans,ans+200);
  cout<<ans[199]<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: no match for 'operator[]' (operand types are 'std::set<char>' and 'int')
   21 |       if(L.find(R[h])==L.end())
      |                  ^
Language: C

#include <stdio.h>
int main(void)
{
	int N;

	scanf_s("%d", &N);
	char str[1001];
	scanf_s("%s", str,N);

	int i;
	int s;
	int ans;
	ans = 0;
	for (i = 0;i <= N; i++)
	{
		s = 0;
		int p;
		int q;
		p = 0;
		q = i+1;
		int y;
		y = 1;

		do {
			do {
				if (str[p] = str[q])


				{
					int k;
					int w = 0;
					for (k = 0; k <= p - 1; k++)
					{
						if (str[p] = str[k])
							s++;
					
					
				else
					s = s;
				q++;
			}while (q <= N);
			p++;
		}while (p <= i);
		if (s >=ans)
			ans = s;
		else
			ans = ans;
		s = 0;
		

	}

	printf("%d", ans);
	return 0;
	





}

Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
main.c:53:9: error: expected 'while' before 'printf'
   53 |         printf("%d", ans);
      |         ^~~~~~
main.c:61:1: error: expected 'while' at end of input
   61 | }
      | ^
main.c:61:1: error: expected declaration or statement at end of input
main.c:61:1: error: expected declaration or statement at end of input
Language: C++

#include <iostream>
#include <string>
#include <math.h>
#include <set>
typedef long long ll;

#define FOR(i,a,b) for(ll i = (a);i < (b);++i)
#define REP(i,n) FOR(i,0,n)

#define debug(x) cout << #x << "=" << x << endl;

using namespace std;

int main(void){

    string str;
    int N;
    cin >> N;
    cin >> str;

    int ans = 0;

    FOR(i,1,str.size()+1){
        string st1 = str.substr(0,i);
        string st2 = str.substr(i);
        set <char> s1;
        set <char> s2;
        REP(j,st1.size()){
            s1.insert(st1[j]);
        }
        REP(j,st2.size()){
            s2.insert(st2[j]);
        }
        set <char> intersect;
        std::set_intersection(s1.begin(),s1.end(),s2.begin(),s2.end(),inserter(intersect,intersect.begin()));
        int cnt = intersect.size();
        ans = max(cnt, ans);
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:14: error: 'set_intersection' is not a member of 'std'
   35 |         std::set_intersection(s1.begin(),s1.end(),s2.begin(),s2.end(),inserter(intersect,intersect.begin()));
      |              ^~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <math.h>
#include <set>
typedef long long ll;

#define FOR(i,a,b) for(ll i = (a);i < (b);++i)
#define REP(i,n) FOR(i,0,n)

#define debug(x) cout << #x << "=" << x << endl;

using namespace std;

int main(void){

    string str;
    int N;
    cin >> N;
    cin >> str;

    int ans = 0;

    FOR(i,1,str.size()+1){
        string st1 = str.substr(0,i);
        string st2 = str.substr(i);
        set <char> s1;
        set <char> s2;
        REP(j,st1.size()){
            s1.insert(st1[j]);
        }
        REP(j,st2.size()){
            s2.insert(st2[j]);
        }
        set <char> intersect;
        set_intersection(s1.begin(),s1.end(),s2.begin(),s2.end(),inserter(intersect,intersect.begin()));
        int cnt = intersect.size();
        ans = max(cnt, ans);
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:9: error: 'set_intersection' was not declared in this scope
   35 |         set_intersection(s1.begin(),s1.end(),s2.begin(),s2.end(),inserter(intersect,intersect.begin()));
      |         ^~~~~~~~~~~~~~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <list>
#include <unordered_map>

using namespace std;

int main()
{
	int N;
	string S;
	cin >> N;
	cin >> S;
	int maxMatch = 0;
	bool juhuku = 0;

	for (int i = 0; i <= N; ++i){
		string X, Y;
		for (int j = 0; j <= N; ++j){
			if (i > j)
				X += S[j];
			else
				Y += S[j];
		}
	/*	cout << "X,Y" << endl;
		cout << X << endl;
		cout << Y << endl;*/

		string match;
		for (int x = 0; x < X.size(); ++x){
			for (int y = 0; y < Y.size(); ++y){
				juhuku = 0;
				if (X[x] == Y[y]){
					for (int m = 0; m < match.size(); ++m){
						if (match[m] == X[x])
							juhuku = 1;
					}
					if (!juhuku)
					match += X[x];
				}
			}
		}
		if (maxMatch < match.size())
			maxMatch = match.size();
	}

	cout << maxMatch << endl;
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:59:18: error: expected '}' at end of input
   59 |         return 0;
      |                  ^
a.cc:20:1: note: to match this '{'
   20 | {
      | ^
Language: C++

int n, c, saidaiti = 0, hokan = 0, ans, z = 0;
    string s;
    cin >> n;
    cin >> s;
    string sone, stwo;
    char h = 'A';
    for(int i = 0; i < n; i++){
        c = 0;
        sone[i] = s[i];
        for(int j = i + 1; j < n; j++){
            stwo[c] = s[j];
            c++;
        }
        for(int k = 0; k <= i; k++){
            for(int l = 0; l <= c; l++){
                if(sone[k] == stwo[l]){
                    if(sone[k] == h){
                        z += z;
                    } else {
                        hokan++;
                    }
                    h = sone[k];
                }
            ans = max(hokan, saidaiti);
            hokan = 0;
            }
        }

    }
    cout << ans << endl;

Compiler output:
a.cc:2:5: error: 'string' does not name a type
    2 |     string s;
      |     ^~~~~~
a.cc:3:5: error: 'cin' does not name a type
    3 |     cin >> n;
      |     ^~~
a.cc:4:5: error: 'cin' does not name a type
    4 |     cin >> s;
      |     ^~~
a.cc:5:5: error: 'string' does not name a type
    5 |     string sone, stwo;
      |     ^~~~~~
a.cc:7:5: error: expected unqualified-id before 'for'
    7 |     for(int i = 0; i < n; i++){
      |     ^~~
a.cc:7:20: error: 'i' does not name a type
    7 |     for(int i = 0; i < n; i++){
      |                    ^
a.cc:7:27: error: 'i' does not name a type
    7 |     for(int i = 0; i < n; i++){
      |                           ^
a.cc:30:5: error: 'cout' does not name a type
   30 |     cout << ans << endl;
      |     ^~~~