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

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

int check(char str2[], char str[]);

int main(void){
	int n;
	scanf("%d", &n);
	
	char str[n];
	scanf("%s", str);
	
	int i;
	int j;
	int c_max;
	int max = 0;
	
	for(i=0;i<=(n-1)/2;i++){
		char str2[50] = {'\0'};
		strncpy(str2, str, i);
		}
		c_max = check(str2, str);
		if(max < c_max){
			max = c_max;
		}
	}
	
	printf("%d", max);
	return 0;
}

int check(char str2[], char str[]){
	int i;
	int j;
	int k;
	int cnt = 0;
	int flag = 0;
	for(i=0;str2[i]!='\0';i++){
		for(k=0;k<i;k++){
			if(str2[k]==str2[i]){
				flag=1;
				break;
			}
		}
		for(j=i;str[j]!='\0'&&flag!=1;j++){
			if(str2[i]==str[j]){
				cnt+=1;
				break;
			}
		}
		flag = 0;
	}
	return cnt;
}

Compiler output:
main.c: In function 'main':
main.c:22:31: error: 'str2' undeclared (first use in this function); did you mean 'str'?
   22 |                 c_max = check(str2, str);
      |                               ^~~~
      |                               str
main.c:22:31: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:28:16: error: expected declaration specifiers or '...' before string constant
   28 |         printf("%d", max);
      |                ^~~~
main.c:28:22: error: unknown type name 'max'
   28 |         printf("%d", max);
      |                      ^~~
main.c:29:9: error: expected identifier or '(' before 'return'
   29 |         return 0;
      |         ^~~~~~
main.c:30:1: error: expected identifier or '(' before '}' token
   30 | }
      | ^
Language: C++

auto string    = std::string("a, b, c");    // 分割対象の文字列
auto separator = std::string(", ");         // 区切り文字
auto separator_length = separator.length(); // 区切り文字の長さ

auto list = std::vector<std::string>();

if (separator_length == 0) {
  list.push_back(string);
} else {
  auto offset = std::string::size_type(0);
  while (1) {
    auto pos = string.find(separator, offset);
    if (pos == std::string::npos) {
      list.push_back(string.substr(offset));
      break;
    }
    list.push_back(string.substr(offset, pos - offset));
    offset = pos + separator_length;
  }
}

list; // list == {"a", "b", "c"}

Compiler output:
a.cc:1:23: error: 'string' is not a member of 'std'
    1 | auto string    = std::string("a, b, c");    // 分割対象の文字列
      |                       ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | auto string    = std::string("a, b, c");    // 分割対象の文字列
a.cc:2:23: error: 'string' is not a member of 'std'
    2 | auto separator = std::string(", ");         // 区切り文字
      |                       ^~~~~~
a.cc:2:23: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
a.cc:5:18: error: 'vector' is not a member of 'std'
    5 | auto list = std::vector<std::string>();
      |                  ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | auto string    = std::string("a, b, c");    // 分割対象の文字列
a.cc:5:30: error: 'string' is not a member of 'std'
    5 | auto list = std::vector<std::string>();
      |                              ^~~~~~
a.cc:5:30: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
a.cc:5:38: error: expected primary-expression before ')' token
    5 | auto list = std::vector<std::string>();
      |                                      ^
a.cc:7:1: error: expected unqualified-id before 'if'
    7 | if (separator_length == 0) {
      | ^~
a.cc:9:3: error: expected unqualified-id before 'else'
    9 | } else {
      |   ^~~~
a.cc:22:1: error: 'list' does not name a type
   22 | list; // list == {"a", "b", "c"}
      | ^~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

//sのposからlen分をtに取り出して返す
int mysubstr(char *t, const char *s, int pos, int len)
{
    if (pos < 0 || len < 0 || len > strlen(s))
        return -1;
    for (s += pos; *s != '\0' && len > 0; len--)
        *t++ = *s++;
    *t = '\0';
    return 0;
}

int main()
{
    int n;
    cin >> n;
    char *s = new char[n];
    cin >> s;

    char s1[100];
    char s2[100];

    char alph = 'a';
    int count = 0;
    int max = -1;
    int i = 0;
    for (int split = 1; split < n; split++)
    {
        count = 0;
        i = 0;
        mysubstr(s1, s, 0, split);
        mysubstr(s2, s, split, n - split);

        string ss1 = s1;
        string ss2 = s2;

        while (!(s1[i] == '\0' || s2[i] == '\0'))
        {
            if (ss1.find(alph + i) != std::string::npos && ss2.find(alph + i) != std::string::npos)
                count++;

            cout << (char)alph + i << endl;

            if (max < count)
                max = count;

            i++;
        }
    }

    cout << max << endl;
    delete[] s;
    return 0;
}

Compiler output:
a.cc: In function 'int mysubstr(char*, const char*, int, int)':
a.cc:9:37: error: 'strlen' was not declared in this scope
    9 |     if (pos < 0 || len < 0 || len > strlen(s))
      |                                     ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#include<bits/stdc++.h>
using namespace std;
int check(string a;string b){
	int ac[26]={0},bc[26]={0},ans=0;
	for(int p=0;a[p]!="\0";p++)
		ac[a[p]-97]++;
	for(int p=0;b[p]!="\0";p++)
		bc[b[p]-97]++;
	for(int p=0;p<26;p++)
		if(ac[p]!=0&&bc[p]!=0) ans++;
		return ans;
}
int main(){
	string s,a,b;
	int n,c[101]={0};
	cin>>n>>s;
	for(int p=0;p<N;p++){
		a=s.substr(0,p);
		b=s.substr(p+1,n-1);
		c[p]=check(a,b);
	}
	sort(c,c+101,greater<int>);
	cout<<c[0];
	return 0;
}

Compiler output:
a.cc:3:19: error: expected ')' before ';' token
    3 | int check(string a;string b){
      |          ~        ^
      |                   )
a.cc:3:28: error: expected initializer before ')' token
    3 | int check(string a;string b){
      |                            ^
a.cc: In function 'int main()':
a.cc:17:23: error: 'N' was not declared in this scope
   17 |         for(int p=0;p<N;p++){
      |                       ^
a.cc:20:27: error: too many arguments to function 'int check(std::string)'
   20 |                 c[p]=check(a,b);
      |                      ~~~~~^~~~~
a.cc:3:5: note: declared here
    3 | int check(string a;string b){
      |     ^~~~~
a.cc:22:34: error: expected primary-expression before ')' token
   22 |         sort(c,c+101,greater<int>);
      |                                  ^
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public classMain {

	public static void main(String[] args){
		  Scanner sc = new Scanner(System.in);
		  int N = sc.nextInt();
		  String S = sc.next();
		  sc.close();
		  
		  int answer = 0;
		  
		  for(int j = 1; j < N; j++) {
			  List<Character> aList = new ArrayList<>();
			  List<Character> bList = new ArrayList<>();
			  String a = S.substring(0, j);
			  String b = S.substring(j, N);

			  for(int i = 0; i < a.length(); i++) {
				  if(!aList.contains(a.charAt(i))) aList.add(a.charAt(i));
			  }
			  
			  for(int i = 0; i < b.length(); i++) {
				  if(!bList.contains(b.charAt(i))) bList.add(b.charAt(i));
			  }
			  
			  char alphabet = 'a';
			  int count = 0;
			  for(int i = 0; i < 26; i++) {
				  if(aList.contains((char)(alphabet + i)) && bList.contains((char)(alphabet + i))) {
					  count++;
				  }
			
			  }
			  answer = Math.max(answer, count);
		  }
		  
		  System.out.println(answer);
	      System.exit(0);
	    }
}

Compiler output:
Main.java:5: error: class, interface, enum, or record expected
public classMain {
       ^
Main.java:7: error: unnamed classes are a preview feature and are disabled by default.
	public static void main(String[] args){
	              ^
  (use --enable-preview to enable unnamed classes)
Main.java:43: error: class, interface, enum, or record expected
}
^
3 errors
Language: C

#include <stdio.h>


void shokika(void);

int i;
char s1[100];

int main(int argc, char **argv)
{
  shokika();
  scanf("%d",&n);
  int n,j,k,l,xxx;
  int x[n];
  char s[n + 1];
  scanf("%s",s);
  for(j = 0 ; j < n ; j++){
    for(k = 0 ; k < j + 1 ; k++){
      s1[k] = s[k];
    }
    for(k = 0 ; k < j ; k++){
      for(l = k ; l < j ; l++){
        if(s1[l] == s1[l + 1]){
          s1[l + 1] = '1';
        }
      }
    }
    for(k = 0 ; k < j + 1 ; k++){
      for(l = k ; l < n ; l++){
        xxx = 0;
        while(xxx == 0){
          if(s1[k] == s[l + 1]){
            xxx == 1;
            x[j]++;
          }
        }
      }
    }
    shokika();
  }
  for(j = 0 ; j < n ; j++){
    for(l = j ; l < n ; l++){
      if(x[l] < x[l+1]){
        xxx = x[l];
        x[l] = x[l + 1];
        x[l + 1] = xxx;
      }
    }  
  }
  printf("%d\n",x[n - 1]);
  return 0;
}

void shokika(void){
  for(i = 0 ; i < 100 ; i++){
    s1[i] = '0';
  }
}

Compiler output:
main.c: In function 'main':
main.c:12:15: error: 'n' undeclared (first use in this function)
   12 |   scanf("%d",&n);
      |               ^
main.c:12:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

using namespace std;
int main() {
	int n=0;
	string src;

	vector<char> ch1,ch2;
	vector<int> num1,num2;

	cin >> n;
	cin >> src;

	for (auto &e : src) {
		if (ch1.empty()) {
			ch1.push_back(e);
			num1.push_back(1);
			continue;
		}
		auto res=find(ch1.begin(), ch1.end(), e);
		if (res==ch1.end()) {
			ch1.push_back(e);
			num1.push_back(num1.back()+1);
		}
		else {
			num1.push_back(num1.back());
		}
		
	}

	for (auto it = src.begin(), e = src.end(); it != e; ++it) {
		if (ch2.empty()) {
			ch2.push_back(*it);
			num2.push_back(1);
			continue;
		}
		auto res = find(ch2.begin(), ch2.end(), *it);
		if (res == ch2.end()) {
			ch2.push_back(*it);
			num2.push_back(num2.back()+1);
		}
		else {
			
			num2.push_back(num2.back());
		}
	}


	int index = 0;
	int max=0;
	int ans = 0;
	for (int i = 0; i < n; i++) {
		if (num1[i] * num2[n-1 - i] > max) {
			max = num1[i] * num2[n-1 - i];
			index = i;
			
			ans = num1[i];
			if (ans > num2[n - 1 - i]) {
				ans = num2[n - 1 - i];
			}
			
		}
		//cout << i << ":" << num1[i] << ":" << num2[n - 1 - i] << ":" << max << ":" << ans << "\n";
	}


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

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

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    int n;
    scanf("%d",&n);
    char a[101];
    getchar();
    gets(a);
    int i,j,k,l,max=0;

    for(i=0; i<=strlen(a)-2; i++)
    {
        int cont[10000]={0};
        for(j=0; j<=i; j++)
        {

            for(k=i+1; k<=strlen(a)-1; k++)
            {
                if(a[j]==a[k])
                {
                    int x=(int)a[j];
                    cont[x]++;

                }
            }



        }
        int sum=0;
            for(l=0; l<10000; l++)
            {
                if(cont[l]!=0)
                    sum=sum+1;
            }
            if(max<sum)
                max=sum;

    }

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


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

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,i,j,b[200];
    char a[200];
  scanf("%d",&n);

int p=n-1;
    scanf("%s",a);
int f=n;
    for(i=0;i<200;i++)
        {b[i]=1;s[i]=0;}
        int r=0;
    while(p--)
    {
        f--; int o=0;
        for(i=0; i<f; i++)
        {

            for(j=n-1;j>=f;j--)
            {
                if((a[i]==a[j])&&b[a[j]])
                {
                    o++;b[a[j]]=0;//printf("f=%d,%c\n",f,a[i]);
                }
            }
        }
        for(i=0;i<222;i++)
            b[i]=1;
        if(r<o)
                r=o;
    }
     //sort(s,s+r+1);
    // for(i=0;i<r;i++)
       printf("%d\n",r);



    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 's' was not declared in this scope
   15 |         {b[i]=1;s[i]=0;}
      |                 ^
Language: C++

#define rep(i, a, b) for(ll (i) = (a); (i) < (b);++i)

int N;
string S;

int main(){
  cin >> N >> S;
  int Max = N;
  for (int i = 0; i < N; ++i){
    int cnt = 0;
    for (int j = 0; j < i; ++j){
      for (int k = i; k < N; ++k){
        if (S[j] == S[k]){
          cnt++;
        }
      }
    }
    Max = max(Max, cnt);
  }
  cout << Max << endl;
  return 0;
}


Compiler output:
a.cc:4:1: error: 'string' does not name a type
    4 | string S;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> N >> S;
      |   ^~~
a.cc:7:15: error: 'S' was not declared in this scope
    7 |   cin >> N >> S;
      |               ^
a.cc:18:11: error: 'max' was not declared in this scope; did you mean 'Max'?
   18 |     Max = max(Max, cnt);
      |           ^~~
      |           Max
a.cc:20:3: error: 'cout' was not declared in this scope
   20 |   cout << Max << endl;
      |   ^~~~
a.cc:20:18: error: 'endl' was not declared in this scope
   20 |   cout << Max << endl;
      |                  ^~~~
Language: C++

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

typedef long long ll;
typedef pair<ll,ll> P;

const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;

#define rep(i, a, b) for(ll (i) = (a); (i) < (b);++i)

int N;
string S;

int main(){
  cin >> N >> S;
  int Min = N;
  for (int i = 0; i < N; ++i){
    int cnt = 0;
    for (int j = 0; j < N; ++j){
      if (i > j && S[i] == 'W'){
        cnt++;
      }
      if (i < j && S[i] == 'E'){
        cnt++;
        cout << "E" << endl;
      }
    }
    cout << cnt << endl;
    Min = min(Min, cnt);
  }
  cout << Min << endl;
  return 0;
}

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

typedef long long ll;
typedef pair<ll,ll> P;

const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;

#define rep(i, a, b) for(ll (i) = (a); (i) < (b);++i)

int N;
string S;

// int mozisu(string S){
//   char kind[S.length()];
//   int cnt = 0, point = 0;
//   for (int i = 0; i < S.length(); ++i){
//     bool all = false;
//     for (int j = 0; j <= point; ++j){
//       if (kind[j] == S[i]){
//         all = true;
//       }
//     }
//     if (!all){
//       kind[point] = S[i];
//       point++;
//       cnt++;
//     }
//   }
//   return cnt;
// }

int main(){
  cin >> N >> S;
  int Max = N;
  for (int i = 0; i < N; ++i){
    int cnt = 0;
    for (int j = 0; j < i; ++j){
      for (int k = i; k < N; ++k){
        if (S[j] == S[k]){
          cnt++;
        }
      }
    }
    Max = max(Max, cnt);
  }
  cout << Max << endl;
  return 0;
}


Compiler output:
a.cc:44:14: error: redefinition of 'const double PI'
   44 | const double PI = 3.14159265358979323846;
      |              ^~
a.cc:7:14: note: 'const double PI' previously defined here
    7 | const double PI = 3.14159265358979323846;
      |              ^~
a.cc:45:14: error: redefinition of 'const double EPS'
   45 | const double EPS = 1e-12;
      |              ^~~
a.cc:8:14: note: 'const double EPS' previously defined here
    8 | const double EPS = 1e-12;
      |              ^~~
a.cc:46:10: error: redefinition of 'const ll INF'
   46 | const ll INF = 1LL<<29;
      |          ^~~
a.cc:9:10: note: 'const ll INF' previously defined here
    9 | const ll INF = 1LL<<29;
      |          ^~~
a.cc:47:10: error: redefinition of 'const ll mod'
   47 | const ll mod = 1e9+7;
      |          ^~~
a.cc:10:10: note: 'const ll mod' previously defined here
   10 | const ll mod = 1e9+7;
      |          ^~~
a.cc:51:5: error: redefinition of 'int N'
   51 | int N;
      |     ^
a.cc:14:5: note: 'int N' previously declared here
   14 | int N;
      |     ^
a.cc:52:8: error: redefinition of 'std::string S'
   52 | string S;
      |        ^
a.cc:15:8: note: 'std::string S' previously declared here
   15 | string S;
      |        ^
a.cc:73:5: error: redefinition of 'int main()'
   73 | int main(){
      |     ^~~~
a.cc:17:5: note: 'int main()' previously defined here
   17 | int main(){
      |     ^~~~
Language: C++

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

using namespace std;

#define	numberof(a)	(sizeof(a) / sizeof(a[0]))
#define	INF		(1000000)
#define Rep(i,n) for(int i = 0; i < (n); i++ )

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define	show(x)	 copy( (x).begin(), (x).end(), ostream_iterator<int>(cout, ",") );	// container<int>を全て表示

using namespace std;

typedef long long ll;

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

ll kaijo( ll N )
{
	// 階乗
	if( N == 0 ) return 1;
	return N * kaijo(N - 1);
}

map<ll, ll> prime_factor(ll N)
{
	// 素因数分解
	map<ll, ll> ret;
	for( ll i = 2; i * i <= N; i++ ){
		while( N % i == 0 ){
			ret[i]++;
			N /= i;
		}
	}
	if(N != 1) ret[N] = 1;
	return ret;
}

ll gcd( ll a, ll b )
{
	// a >= b
	if( b > a ) swap(a, b);
	if( b == 0 ) return a;
	return gcd( a % b, b );
}

ll lcm( ll a, ll b )
{
	return a * b / gcd(a, b);
}

ll max( ll a, ll b )
{
	if( a > b ) return a;
	return b;
}
ll min( ll a, ll b )
{
	if( a > b ) return b;
	return a;
}

int main()
{
	ll N = 0;
	ll ans = 0;
	string S = "";

	cin >> N >> S;

	for( ll i = 1; i < N - 1; ++i ){
		string X = S.substr(0, i);
		string Y = S.substr(i, N - i);
		set<char> tmp;

		for(ll j = 0; j < X.length(); ++j){
			for(ll k = 0; k < Y.length(); ++k){
				if(X[j] == Y[k]) tmp.insert(X[j]);
			}
		}
		ans = max(ans, tmp.size());
	}
	cout << ans << endl;

	return 0;
}


Compiler output:
a.cc:30:20: error: 'acos' was not declared in this scope
   30 | const double PI  = acos(-1.0);
      |                    ^~~~
Language: C++

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

using namespace std;

#define	numberof(a)	(sizeof(a) / sizeof(a[0]))
#define	INF		(1000000)
#define Rep(i,n) for(int i = 0; i < (n); i++ )

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define	show(x)	 copy( (x).begin(), (x).end(), ostream_iterator<int>(cout, ",") );	// container<int>を全て表示

using namespace std;

typedef long long ll;

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

ll kaijo( ll N )
{
	// 階乗
	if( N == 0 ) return 1;
	return N * kaijo(N - 1);
}

map<ll, ll> prime_factor(ll N)
{
	// 素因数分解
	map<ll, ll> ret;
	for( ll i = 2; i * i <= N; i++ ){
		while( N % i == 0 ){
			ret[i]++;
			N /= i;
		}
	}
	if(N != 1) ret[N] = 1;
	return ret;
}

ll gcd( ll a, ll b )
{
	// a >= b
	if( b > a ) swap(a, b);
	if( b == 0 ) return a;
	return gcd( a % b, b );
}

ll lcm( ll a, ll b )
{
	return a * b / gcd(a, b);
}

ll max( ll a, ll b )
{
	if( a > b ) return a;
	return b;
}
ll min( ll a, ll b )
{
	if( a > b ) return b;
	return a;
}

class UnionFind
{
public:
	vector<int> parent;
	vector<int> rank;

	UnionFind(int n)
	{
		Rep(i, n){
			parent.push_back(i);
			rank.push_back(1);
		}
	}
	int root(int x)
	{
		if( parent[x] != x ) parent[x] = root(parent[x]);
		return parent[x];
	}
	void unite(int x, int y)
	{
		int rx = root(x);
		int ry = root(y);
		if( rx == ry ) return;
		if( rank[rx] > rank[ry] ){
			parent[ry] = rx;
			rank[rx] += rank[ry];
		}
		if( rank[rx] <= rank[ry] ){
			parent[rx] = ry;
			rank[ry] += rank[rx];
		}
	}
};

int main()
{
	ll N = 0;
	ll ans = 0;
	string S = "";

	cin >> N >> S;

	for( ll i = 1; i < N - 1; ++i ){
		string X = S.substr(0, i);
		string Y = S.substr(i, N - i);
		set<char> tmp;

		for(ll j = 0; j < X.length(); ++j){
			for(ll k = 0; k < Y.length(); ++k){
				if(X[j] == Y[k]) tmp.insert(X[j]);
			}
		}
		ans = max(ans, tmp.size());
	}
	cout << ans << endl;

	return 0;
}


Compiler output:
a.cc:30:20: error: 'acos' was not declared in this scope
   30 | const double PI  = acos(-1.0);
      |                    ^~~~
Language: C++

n = gets.chomp.to_i
a = []
a = gets.split("")
b = []
c = []
cnt = []
t = 0
alp = ('a'..'z').to_a
for i in 0..n-1
t = 0
b = []
c = []
  for j in 0..i
  b.push(a[j])
  end
  for j in i+1..n-1
  c.push(a[j])
  end
 b.uniq!
 c.uniq!
  #puts b.join("")
  #puts c.join("")
  for j in 0..25
  #puts j
  #puts t
  #puts alp[j]
    if b.include?(alp[j])
        if c.include?(alp[j])
      t = t + 1
        end
    end
  end
  #puts t
  cnt.push(t)
end

#puts cnt.join (" ")
puts cnt.max

Compiler output:
a.cc:9:10: error: too many decimal points in number
    9 | for i in 0..n-1
      |          ^~~~
a.cc:13:12: error: too many decimal points in number
   13 |   for j in 0..i
      |            ^~~~
a.cc:16:14: error: too many decimal points in number
   16 |   for j in i+1..n-1
      |              ^~~~
a.cc:21:4: error: invalid preprocessing directive #puts
   21 |   #puts b.join("")
      |    ^~~~
a.cc:22:4: error: invalid preprocessing directive #puts
   22 |   #puts c.join("")
      |    ^~~~
a.cc:23:12: error: too many decimal points in number
   23 |   for j in 0..25
      |            ^~~~~
a.cc:24:4: error: invalid preprocessing directive #puts
   24 |   #puts j
      |    ^~~~
a.cc:25:4: error: invalid preprocessing directive #puts
   25 |   #puts t
      |    ^~~~
a.cc:26:4: error: invalid preprocessing directive #puts
   26 |   #puts alp[j]
      |    ^~~~
a.cc:33:4: error: invalid preprocessing directive #puts
   33 |   #puts t
      |    ^~~~
a.cc:37:2: error: invalid preprocessing directive #puts
   37 | #puts cnt.join (" ")
      |  ^~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n = gets.chomp.to_i
      | ^
Language: C++

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

int main()
{
    int n;
    string s;
    cin >> n >> s;
    int ans =0;
    for(int i=0; i<n; i++){
        int current =0;
        set<char> fs;
        for(int j = 0; j<i; j++){
            fs.insert(s[j]);
        }
        for(auto c: fs){
            // cout << i<< " :: " << c << endl;
            for(int k=i; k<n; k++){
                if(s[k] == c){
                    current++;
                    break;
                }
            }
        }
        //cout << i << " :" << ans << endl;
        ans = max(ans,current);
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'set' was not declared in this scope
   13 |         set<char> fs;
      |         ^~~
a.cc:2:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    1 | #include <iostream>
  +++ |+#include <set>
    2 | #include <string>
a.cc:13:13: error: expected primary-expression before 'char'
   13 |         set<char> fs;
      |             ^~~~
a.cc:15:13: error: 'fs' was not declared in this scope; did you mean 's'?
   15 |             fs.insert(s[j]);
      |             ^~
      |             s
a.cc:17:21: error: 'fs' was not declared in this scope; did you mean 's'?
   17 |         for(auto c: fs){
      |                     ^~
      |                     s
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<map>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
#define m(a,b) memset(a,b,sizeof(a));
const int maxn = 100;
typedef long long LL;
int mp[36];
char a[105];
int vis[28];
int main(){
	int n;
	scanf("%d",&n);
	getchar();
	gets(a);
	int ans = 0,pos = 0;
	for(int i = 0;i<n;i++){
		mp[a[i]-'a']++;
		pos = 0;
		for(int k = 0;k<28;k++)
			vis[k] = 0;
		for(int j = i+1;j<n;j++){
			if(vis[a[j]-'a']) continue;
			if(mp[a[j]-'a']) {
				vis[a[j]-'a'] = 1;
				pos++;
			}
		}
		ans = max(ans,pos);
	}
	printf("%d\n",ans);
	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main ()  {
    set<char>s;
int n;
cin>>n;
string x;
cin>>x;
for(int i=0;i<n/2;i++){
    for(int j=n/2;j<n;j++){
        if(x[i]==x[j]){
            s.insert(x[j])
        }
    }
}
cout<<s.size();
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:27: error: expected ';' before '}' token
   12 |             s.insert(x[j])
      |                           ^
      |                           ;
   13 |         }
      |         ~
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-1;i++)
	{
		map<char,int> l;
		int anso=0;
		for(int j=0;j<i;j++) l[s[j]]++;
		for(int j=i;j<n;j++)
		{
			if(l[s[j]]) anso++,l[s[j]]=0;
		}
		ans=(anso>ans?anso:ans);
		l.clear();
	}
	cout<<ans<<'\n';
	return 0;
}

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

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<map>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
#define m(a,b) memset(a,b,sizeof(a));
const int maxn = 100;
typedef long long LL;
int mp[36];
char a[105];
int vis[28];
int main(){
	int n;
	cin >> n;
	getchar();
	gets(a);
	int ans = 0,pos = 0;
	for(int i = 0;i<n;i++){
		mp[a[i]-'a']++;
		pos = 0;
		m(vis,0);
		for(int j = i+1;j<n;j++){
			if(vis[a[j]-'a']) continue;
			if(mp[a[j]-'a']) {
				vis[a[j]-'a'] = 1;
				pos++;
			}
		}
		ans = max(ans,pos);
	}
	cout << ans << endl;
	return 0;
}

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

#include <iostream>
#include <string>
#include <vector>
using namespace std;
using ll = long long;

int main(int argc, const char * argv[]) {
    int n;
    string s;
    cin >> n >> s;
    string x, y;
    int cnt, max = 0;
    char pre = '0';
    for (int i = 1; i < n; i++) {
        x.clear();
        y.clear();
        cnt = 0;
        pre = '0';
        
        x = s.substr(0, i);
        y = s.substr(i, n - i);
        sort(x.begin(), x.end());
        sort(y.begin(), y.end());
        //cout << x << ' ' << y;
        for (i = 0; i < x.length(); i++) {
            for (int j = 0; j < y.length() && pre != x[i]; j++) {
                if (x[i] == y[j]) {
                    pre = x[i];
                    cnt++;
                    break;
                }
            }
        }
        //cout << ' ' << cnt << endl;
        if (max < cnt) {
            max = cnt;
        }
        //sort(x.begin(), x.end());
    }
    cout << max << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:22:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   22 |         sort(x.begin(), x.end());
      |         ^~~~
      |         short
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<map>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
#define m(a,b) memset(a,b,sizeof(a));
const int maxn = 100;
typedef long long LL;
int mp[36];
char a[maxn+5];
int vis[28];
int main(){
	int n;
	cin >> n;
	getchar();
	gets(a);
	int ans = 0;
	for(int i = 0;i<n;i++){
		mp[a[i]-'a']++;
		int pos = 0;
		memset(vis,0,sizeof(vis));
		for(int j = i+1;j<n;j++){
			if(vis[a[j]-'a']) continue;
			if(mp[a[j]-'a']) {
				vis[a[j]-'a'] = 1;
				pos++;
			}
		}
		ans = max(ans,pos);
	}
	cout << ans << endl;
	return 0;
}

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

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<map>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
#define m(a,b) memset(a,b,sizeof(a));
const int maxn = 1e5;
typedef long long LL;
int mp[36];
char a[maxn+5];
int vis[28];
int main(){
	int n;
	cin >> n;
	getchar();
	gets(a);
	int ans = 0;
	for(int i = 0;i<n;i++){
		mp[a[i]-'a']++;
		int pos = 0;
		memset(vis,0,sizeof(vis));
		for(int j = i+1;j<n;j++){
			if(vis[a[j]-'a']) continue;
			if(mp[a[j]-'a']) {
				vis[a[j]-'a'] = 1;
				pos++;
			}
		}
		ans = max(ans,pos);
	}
	cout << ans << endl;
	return 0;
}

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

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<map>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
#define m(a,b) memset(a,b,sizeof(a));
const int maxn = 1e5;
typedef long long LL;
map<char,int>mp;
char a[maxn+5];
int vis[28];
int main(){
	int n;
	cin >> n;
	getchar();
	gets(a);
	int ans = 0;
	for(int i = 0;i<n;i++){
		mp[a[i]]++;
		int pos = 0;
		memset(vis,0,sizeof(vis));
		for(int j = i+1;j<n;j++){
			if(vis[a[j]-'a']) continue;
			if(mp[a[j]]) {
				vis[a[j]-'a'] = 1;
				pos++;
			}
		}
		ans = max(ans,pos);
	}
	cout << ans << endl;
	return 0;
}

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

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<map>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
#define m(a,b) memset(a,b,sizeof(a));
const int maxn = 1e5;
typedef long long LL;
map<char,int>mp;
int main(){
	int n;
	cin >> n;
	char a[maxn+5];
	int vis[28];
	getchar();
	gets(a);
	int ans = 0;
	for(int i = 0;i<n;i++){
		mp[a[i]]++;
		int pos = 0;
		memset(vis,0,sizeof(vis));
		for(int j = i+1;j<n;j++){
			if(vis[a[j]-'a']) continue;
			if(mp[a[j]]) {
				vis[a[j]-'a'] = 1;
				pos++;
			}
		}
		ans = max(ans,pos);
	}
	cout << ans << endl;
	return 0;
}

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

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

int main(){
  int N;
  string str;
  cin>>N>>str;
  vector<int> dataW(N);
  vector<int> dataE(N);
  if(str.at(0)=='W'){dataW.at(0)=1;}else{dataW.at(0)=0;}
  if(str.at(N-1)=='E'){dataE.at(0)=1;}else{dataE.at(0)=0;}
  for(int i=1;i<N;i++){
    if(dataW.at(i)=='W'){
      dataW.at(i)=dataW.at(i-1)+1;
    }else{
      dataW.at(i)=dataW.at(i-1);
    }
    if(dataE.at(N-1-i)=='E'){
      dataE.at(i)=dataE.at(i-1)+1;
    }else{
      dataE.at(i)=dataE.at(i-1);
    }
  }
  
  int cnt=dataE.at(N-2);
  for(int i=1;i<N-1;i++){
    int tmp=dataW.at(i-1)+dataE.at(N-2-i);
    cnt=min(cnt,tmp);
  }
  cnt=min(cnt,dataE(N-2));
  cout<<cnt<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:20: error: no match for call to '(std::vector<int>) (int)'
   30 |   cnt=min(cnt,dataE(N-2));
      |               ~~~~~^~~~~
Language: C++

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

int main(){
  int N;
  string str;
  cin>>N>>str;
  vector<int> data(N);
  if(str.at(0)=='W'){data.at(0)=1;}else{data.at(0)=0;}
  for(int i=1;i<N;i++){
    if(data.at(i)=='W'){data.at(i)+=data.at(i-1)+1;}
    else{data.at(i)=data.at(i-1);}
  }
  int cnt=(N-1)-(data.at(N-1)-data.at(0));
  for(int i=1;i<N;i++){
    int tmp=data.at(i-1)+((N-1-i)-data.at(N-1)-data.at(i));
    cnt=min(cnt,tmp)
  }
  cout<<cnt<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:21: error: expected ';' before '}' token
   17 |     cnt=min(cnt,tmp)
      |                     ^
      |                     ;
   18 |   }
      |   ~
Language: C++

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

int main(){
  int N;
  string str;
  cin>>N>>str;
  vector<int> data(N);
  if(str.at(0)=='W'){data.at(0)=1;}else{data.at(0)=0;}
  for(int i=1;i<N;i++){
    if(data.at(i)=='W'){data.at(i)+=data.at(i-1)+1;}
    else{data.at(i)==data.at(i-1);}
  }
  int cnt=(N-1)-(data.at(N-1)-data.at(0));
  for(int i=1;i<N;i++){
    int tmp=data.at(i-1)+((N-1-i)-data.at(N-1)-data.at(i));
    cnt=min(cnt,tmp)
  }
  cout<<cnt<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:21: error: expected ';' before '}' token
   17 |     cnt=min(cnt,tmp)
      |                     ^
      |                     ;
   18 |   }
      |   ~
Language: C++

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

int main(){
  int N;
  string str;
  cin>>N>>str;
  vector<int> data(N);
  if(str.at(0)=='W'){data.at(0)=1;}else{data.at(0)=0;}
  for(int i=1;i<N;i++;){
    if(data.at(i)=='W'){data.at(i)+=data.at(i-1)+1;}
    else{data.at(i)==data.at(i-1);}
  }
  int cnt=(N-1)-(data.at(N-1)-data.at(0));
  for(int i=1;i<N;i++){
    int tmp=data.at(i-1)+((N-1-i)-data.at(N-1)-data.at(i));
    cnt=min(cnt,tmp)
  }
  cout<<cnt<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: expected ')' before ';' token
   10 |   for(int i=1;i<N;i++;){
      |      ~               ^
      |                      )
a.cc:10:23: error: expected primary-expression before ')' token
   10 |   for(int i=1;i<N;i++;){
      |                       ^
a.cc:17:21: error: expected ';' before '}' token
   17 |     cnt=min(cnt,tmp)
      |                     ^
      |                     ;
   18 |   }
      |   ~
Language: C++

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

int main(){
  int N,ch=0,tmp;
  cin>>N;
  string str;
  cin>>str;
  for(int i=1;i<N;i++){
    if(str.at(i)=='W'){ch++;}
  }
  ch=tmp1;
  for(int i=1;i<N;i++){
    if(str.at(i)=='W'){tmp--;}
    if(str.at(i-1)=='E'){tmp++;}
    ch=min(ch,tmp);
  }
  cout<<ch<<endl;
}


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

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

int main()
{
  int N;
  string S;

  cin >> N >> S[i];

  int attention = INT_MAX;
  for (int i = 0; i < N; i++)
  {
    int cnt = 0;
    for (int j = i - 1; j >= 0; j--)
      if (S[j] == 'W') cnt++;
    for (int j = i + 1; j < N; j++)
      if (S[j] == 'E') cnt++;
    attention = min(attention, cnt);
  }
  cout << attention << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'i' was not declared in this scope
   10 |   cin >> N >> S[i];
      |                 ^
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int N;
  string S;

  cin >> N;
  for (int i = 0; i < N; i++) cin >> S[i];

  int attention = INT_MAX;
  for (int i = 0; i < N; i++)
  {
    int cnt = 0;
    for (int j = i - 1; j >= 0; j--)
      if (S[j] == 'W') cnt++;
    for (int j = i + 1; j < N; j++)
      if (S[j] == 'E') cnt++;
    attention = min(attention, cnt);
  }
  cout << attention << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: 'INT_MAX' was not declared in this scope
   12 |   int attention = INT_MAX;
      |                   ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 | using namespace std;
Language: C++

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

int main(){
int n;
  cin >> n;
string s;
  cin >> s;
vector<int> e(n);  
vector<int> w(n);
for(int i=0;i<n;i++){
if(s[i]=='E')e[i]=1;
if(s[i]=='W')w[i]=1;  
}
ans=1000000;
vector<int> sume(n+1,0);  
vector<int> sumw(n+1,0); 
for(int i=0;i<n;i++)sume[i+1]=sume[i]+e[i];
for(int i=0;i<n;i++)sumw[i+1]=sumw[i]+w[i]; 
for(int i=0;i<n;i++){
int k=sumw[i]+sume[n+1]-sume[i+1];
ans=min(k,ans);
}  
cout << ans << endl;  
}


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

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

int main(){
int n;
  cin >> n;
string s;
  cin >> s;
vector<int> e(n);  
vector<int> w(n);
for(int i=0;i<n;i++){
if(s[i]=='E')e[i]=1;
if(s[i]=='W')w[i]=1;  
}
ans=1000000;
vector<int> sume(n+1,0);  
vector<int> sumw(n+1,0); 
for(int i=0;i<n;i++)sume[i+1]=sum[i]+e[i];
for(int i=0;i<n;i++)sumw[i+1]=sum[i]+w[i]; 
for(int i=0;i<n;i++){
int k=sumw[i]+sume[n+1]-sum[i+1];
ans=min(k,ans);
}  
cout << ans << endl;  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:1: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 | ans=1000000;
      | ^~~
      | abs
a.cc:18:31: error: 'sum' was not declared in this scope; did you mean 'sumw'?
   18 | for(int i=0;i<n;i++)sume[i+1]=sum[i]+e[i];
      |                               ^~~
      |                               sumw
a.cc:19:31: error: 'sum' was not declared in this scope; did you mean 'sumw'?
   19 | for(int i=0;i<n;i++)sumw[i+1]=sum[i]+w[i];
      |                               ^~~
      |                               sumw
a.cc:21:25: error: 'sum' was not declared in this scope; did you mean 'sumw'?
   21 | int k=sumw[i]+sume[n+1]-sum[i+1];
      |                         ^~~
      |                         sumw
Language: C++

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

int main(){
int n;
  cin >> n;
string s;
  cin >> s;
vector<int> e(n);  
vector<int> w(n);
for(int i=0;i<n;i++){
if(s[i]=='E')e[i]=1;
if(s[i]=='W')w[i]=1;  
}
ans=1000000;
vector<int> sume(n+1,0);  
vector<int> sumw(n+1,0); 
for(int i=0;i<n;i++)sume[i+1]=sum[i]+e[i];
for(int i=0;i<n;i++)sumw[i+1]=sum[i]+w[i]; 
for(int i=0;i<n;i++){
int k=sumw[i]+sume[n+1]-sum[i+1];
ans=min(k,ans)
}  
cout << ans << endl;  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:1: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 | ans=1000000;
      | ^~~
      | abs
a.cc:18:31: error: 'sum' was not declared in this scope; did you mean 'sumw'?
   18 | for(int i=0;i<n;i++)sume[i+1]=sum[i]+e[i];
      |                               ^~~
      |                               sumw
a.cc:19:31: error: 'sum' was not declared in this scope; did you mean 'sumw'?
   19 | for(int i=0;i<n;i++)sumw[i+1]=sum[i]+w[i];
      |                               ^~~
      |                               sumw
a.cc:21:25: error: 'sum' was not declared in this scope; did you mean 'sumw'?
   21 | int k=sumw[i]+sume[n+1]-sum[i+1];
      |                         ^~~
      |                         sumw
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, c) for (int i = 0; i < (int)c; i++)
int main() {
    int n;
    scanf("%d", &n);
    strint s;
    cin >> s;

    int count[n + 1];
    // i文字目までにWがいくつあるか(1-indexed)

    // 累積和テーブル
    count[0] = 0;
    rep(i, n) {
        // その地点までの累積和だから前のcount[i]を代入してる
        count[i + 1] = count[i];
        // もしwなら加算
        if (s[i] == 'W') ++count[i + 1];
    }

    int ans = n;
    for (int i = 1; i <= n; ++i) {
        // 自分より西にいて西を向いている人が
        //  count[i-1]人
        // 自分より東にいて東を向いている人が
        //  (n-i)-(count[n]-count[i])人
        ans = min(ans, count[i - 1] + (n - i) - (count[n] - count[i]));
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'strint' was not declared in this scope; did you mean 'strcat'?
    7 |     strint s;
      |     ^~~~~~
      |     strcat
a.cc:8:12: error: 's' was not declared in this scope
    8 |     cin >> s;
      |            ^
Language: C++

あーしゅごいしゅごいよく頑張りましたねー

Compiler output:
a.cc:1:1: error: '\U00003042\U000030fc\U00003057\U00003085\U00003054\U00003044\U00003057\U00003085\U00003054\U00003044\U00003088\U0000304f\U00009811\U00005f35\U0000308a\U0000307e\U00003057\U0000305f\U0000306d\U000030fc' does not name a type
    1 | あーしゅごいしゅごいよく頑張りましたねー
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,sw,i,min;
  sw=0;
  cin >> n;
  string h;
  cin >> h;
  
  for(i=0;i<n;++i)
  {
  if(h.at(i)=='E') sw++;
  }
  
  min=sw;
  
  for(i=1;i<n+1;i++)
  {
  if(h.at(i-1)=='W') sw++;
  if(h.at(i-1)=='E') sw--;
  if(sw < min) min=sw;
  }
  
  printf("%d",min);
  
return 0;
}

Compiler output:
main.c:1:9: 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;

int main() {
  int N;
  cin >> N;
  vector<int>data(N);
  for(int i:data){
    char a;
    cin >> a;
    if(a=='W') data.at(i)=0;
    else data.at(i)=1;
  }
  vector<int>result(N);
  it one=0;
  for(int i=1;i<N;i++){
    one+=data.at(i);
  }
  result.at(0)=one;
  for(int i=1;i<N;i++){
    int a=0;
    if(data.at(i)==1) a--;
    if(data.at(i-1)==0) a++;
    result.at(i)=result.at(i-1)+a;
  }
  sort(result.begin(),result.end());
  cout << result.at(0) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'it' was not declared in this scope; did you mean 'int'?
   15 |   it one=0;
      |   ^~
      |   int
a.cc:17:5: error: 'one' was not declared in this scope
   17 |     one+=data.at(i);
      |     ^~~
a.cc:19:16: error: 'one' was not declared in this scope
   19 |   result.at(0)=one;
      |                ^~~
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        char[] c = sc.next().toCharArray();
        int[] d = new int[a];
        for(int i=0; i< a; i++) {
            int count =0;
            for(int j=0; j<i; j++) {
                if(c[j] == 'W') {
                    count++;
                }
            }
            for(int k=i+1; k<a; k++) {
                if(c[k] == 'E') {
                    count++;
                }
            }
            d[i] = count;
        }
        OptionalInt min = Arrays.stream(d).min();
        System.out.println(min);
    }

Compiler output:
Main.java:25: error: reached end of file while parsing
    }
     ^
1 error
Language: Java

import java.util.Scanner;

public class Main104 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextLine();
        char[] s = sc.nextLine().toCharArray();
        sc.close();

        int[] wCnt = new int[n];
        int[] eCnt = new int[n];
        for(int i=0; i<n; i++) {
            if(s[i] == 'W') {
                wCnt[i]++;
            } else {
                eCnt[i]++;
            }
            if(i != 0) {
                wCnt[i] += wCnt[i-1];
                eCnt[i] += eCnt[i-1];
            }
        }

        int ans = 0;
        for(int i=0; i<n; i++) {
            if(i == 0) {
                ans = eCnt[n-1] - eCnt[0];
            } else {
                ans = Math.min(ans, wCnt[i-1] + (eCnt[n-1] - eCnt[i]));
            }
        }
        System.out.println(ans);
    }
}


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

#include <iostream>
#include <cassert>
#include <algorithm>
#include <functional>
#include <vector>
using namespace std;

int main(){
  string S;
  int N;
  cin>>N>>S;
  vector<int> V(N);
  for(int i=1;i<N;i++){
    V.at(i)=V.at(i-1);
    if(S.at(i-1)=='W'){
      V.at(i)++;
    }
  }
  vector<int> dp(N);
  dp.at(0)=1;
  int k=0
  for(int i=1;i<N;i++){
    k=dp.at(i-1);
    if(S.at(i)=='E'){
      k++;
    }
    dp.at(i)=min(k,V.at(i));
  }
  cout<<dp.at(N-1);
}
    
      
    

Compiler output:
a.cc: In function 'int main()':
a.cc:22:3: error: expected ',' or ';' before 'for'
   22 |   for(int i=1;i<N;i++){
      |   ^~~
a.cc:22:15: error: 'i' was not declared in this scope
   22 |   for(int i=1;i<N;i++){
      |               ^
Language: C++

#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#define rep(i,n) for (long long i=0; i < (n); ++i)
#define rep2(i,n,m) for(long long i=n;i<=m;i++)
#define ALL(a)  (a).begin(),(a).end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
int main() {
 int n; 
 cin >> n;
 string s ;
 cin >> s ;
 ll kaisuu = 0;
 rep2(i,1,n-1) if(s[i]=='E') kaisuu ++ ;
 ll ans= INF ;
 rep(i,n-1){
   if(s[i]=='E'&&s[i+1]=='E')
   kaisuu--;
   if(s[i]=='W'&& s[i+1]=='W')
   kaisuu ++ ;
   ans=min(ans,kaisuu)
 } 
 cout <<ans<<endl ;
     return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:23: error: expected ';' before '}' token
   27 |    ans=min(ans,kaisuu)
      |                       ^
      |                       ;
   28 |  }
      |  ~
Language: C++

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

int main(){
    int n;
    string s;
    cin >> n >> s;
    int ce = 0;
    int cw = 0;
    rep(i,n){
        if(s[i] == "E")ce++;
        else cw++;
    }
    int ans = 1e9;
    int e = ce;
    int w = 0;
    rep(i,n){
        if(s[i] == 'E') e--;
        ans = min(ans,e+w);
        if(s[i] == 'W') w++;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |         if(s[i] == "E")ce++;
Language: C++

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

int main(){
    int n;
    string s;
    cin >> n >> s;
    vector<int> cnt(2);
    rep(i,s.size()){
        cnt[s[i]]++;
    }
    int ans = 1e9;
    int w = 0;
    int e = cnt['E'];
    rep(i,n){
        if(s[i] == 'E'){
            e--;
        }
        if(s[i] == 'W') w++;
        ans = min(e + w);
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:18: error: no matching function for call to 'min(int)'
   23 |         ans = min(e + w);
      |               ~~~^~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   template argument deduction/substitution failed:
a.cc:23:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   23 |         ans = min(e + w);
      |               ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 1 provided