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

#include <algorithm>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <functional>
#include <string>
#include <cstdlib>
#include <numeric>
#include <cstdbool>
#include <map> 
#include<set>
#include<queue>

typedef long long ll;


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

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const long long INF = 1000000000000000;
typedef pair<int, int> P;
ll ma = 1000000000 + 7;
ll h, w, n, m,k; string s; string sp;
char maze[60][60];
int dis[60][60];
int dx[4] = { 1, 0, -1, 0 };
int dy[4] = { 0, 1, 0, -1 };

int main() {
	cin >> n >> s; int ans1 = 0; int ans2 = 0; int ans3a = 0; int ans3b = 0;
	for (int i = 0; i < n; i++) {
		if (s[i] == '.') {
			ans1++;
		}
		else if (s[i] == '#') {
			ans2++;
		}
	}
	int res = min(ans1, ans2);
	int ni = 0; bool flg = false;
	if (s[0] == '.') {
		for (int i = 1; i < n; i++) {
			if (s[i] == '#'&&!flg) {
				flg = true;
				for (int j = i; j < n; j++) {
					if (s[j] == '.') {
						ans3a++;
					}
					else if (s[j] == '#') {
						ans3b++;
					}
				}
			}
			if (flg) {
				break;
			}
		}
		chmin(res, ans3a);
		chmin(res, ans3b);
	}
	cout << res << endl;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:9: error: 'cin' was not declared in this scope
   33 |         cin >> n >> s; int ans1 = 0; int ans2 = 0; int ans3a = 0; int ans3b = 0;
      |         ^~~
a.cc:13:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   12 | #include<queue>
  +++ |+#include <iostream>
   13 | 
a.cc:64:9: error: 'cout' was not declared in this scope
   64 |         cout << res << endl;
      |         ^~~~
a.cc:64:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:64:24: error: 'endl' was not declared in this scope
   64 |         cout << res << endl;
      |                        ^~~~
a.cc:13:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
   12 | #include<queue>
  +++ |+#include <ostream>
   13 |
Language: C

#include<stdio.h>
int main(void){
    int i,n,cnt=0;
    char stone[20000000];
    scanf("%d"&n);
    scanf("%s",stone);
    for(i=0;i<n;i++){
        if(stone[i]=='#'&&stone[i+1]=='.'){
            stone[i+1]='#';
            cnt+=1;
        }
    }
    printf("%d",cnt);
    return 0;
    
}

Compiler output:
main.c: In function 'main':
main.c:5:15: error: invalid operands to binary & (have 'char *' and 'int')
    5 |     scanf("%d"&n);
      |           ~~~~^
      |           |
      |           char *
Language: C++

#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define INF 1e9
#define MOD 1e9+7
typedef long long llong;
using namespace std;

int main(){
	int n;
	string s;
	cin>>n>>s;
	
	int sum=0;//w.
	int summ=0;//b.
	int cnt=0;
	int j;
	for(j=n-1;j>=0;--j){
		if(s[i]!='#'){
			cnt++;
			break;
		}
	}
	for(int i=j-1;i>=0;--i){
		if(s[i]=='.') cnt++;
		else{
			summ++;
			sum+=cnt;
			cnt=0;
		}
	}
	
	cout<<min(sum,summ)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:22: error: 'i' was not declared in this scope
   19 |                 if(s[i]!='#'){
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
/*int unchi(){
	int N;
	string S;
	cin >> N >> S;
	int boarder = 0;
	int min = 0;
	for(int i = 0; i <= N; i++){
		int count = 0;
		for(int j = 0; j < N; j++){
			if(i <= j){
				if(S[i] != '.')
					count++;
			}else{
				if(S[i] != '#')
					count++;
			}
		}
		if(min > count)
			min = count;
	}
	cout << min << endl;
}*/

int main(){
	int N;
	string S;
	cin >> N >> S;
	vector<int> sdat(N+1);
	int tmp = 0;
	char c = '.';
	for(int i = 0; i < N; i++){
		if(S[i] != c){
			c = S[i];
			tmp++;
		}
		sdat[tmp]++;
	}
	int min = 0;
	for(int i = 0; i < sdat.size(); i+=2){
		min += sdat[i];
	}
	int last = min;
	int count = 0;
	for(int i = 0; i < sdat.size(); i++){
		count = last;
		count -= sdat[i];
		count += sdat[i+1]
		last = count;
		if(min > count)
			min = count;
	}
	cout << min << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:35: error: expected ';' before 'last'
   49 |                 count += sdat[i+1]
      |                                   ^
      |                                   ;
   50 |                 last = count;
      |                 ~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;

int main()
{
    ll n;
    string str;
    cin >> n >> str;
    ll count = 0, count2 = 0;
    bool found = false;
    ll limit = n;
    for (ll i = n-1; (i >= 0); --i) {
        if (str[i] != '#') {
            limit = i+1;
            break;
        }
    }
    for (ll i = 0; (i < limit); ++i) {
        if (str[i] == '#') {
            count++;
            found = true;
        }
        if (found && str[i] == '.') {
            count2++;
        }
    }
    cout << result << endl;
    return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  string s;
  cin >> n >> s ;
int i;
int black=1;
int white=0;
int flag=0;
for (i=0;i<n;i++)
  {if (flag ==0)
    { if (s[i]=='#'&&s[i+1]=='#')flag =1;}
  else
    {if (s[i] == '.')white++;
    if (s[i] == '#')black++;}
  }

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

#include <iostream>

using namespace std;

int main(){
  int N;
  int ham;
  std::string S;
  cin >> N >> S;
  int ham_min = N;
  for (int index =0; index<N+1; index++){
    std::string last;
    for (int j=0;j<N;j++){
      if(index <= j){
        last[j] = "#";
      }
      else{
        last[j] = ".";
      }
    }
    ham = 0;
    for(int i=0; i<N; i++){
      if (S[i] != last[i]){
        ham++;
      }
    }
    if(ham < ham_min){
      ham_min = ham;
    }
  }
  std::cout << ham_min << std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   15 |         last[j] = "#";
      |                   ^~~
      |                   |
      |                   const char*
a.cc:18:19: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   18 |         last[j] = ".";
      |                   ^~~
      |                   |
      |                   const char*
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  string s;
  cin >> n >> s ;
int i;
int black=1;
int white=0;
int flag=0;
for (i=0;i<n;i++)
  {if (flag ==0)
    { if (s[i]=='#'&&s[i+1]=='#')flag =1;}
  else
    {if (s[i] == '.')white++;
    {if (s[i] == '#')black++;}
  }

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

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

using namespace std;
int main(void){
    int N;
    string S;
    cin >> N >> S;
    int cnt1 = 0;
    int cnt2 = 0;
    int now = 1;
    int flag1 = 0;
    int flag2 = 0;
    if(S[0] == '.'){
        flag1 = 1;
        now = 0;
    }
    for(int i = 0; i < N; i++){
        if(S[i] == '#'){
            cnt2 += 1;
        }
        if(now == 1){
            if(S[i] == '.' and flag1 != 1){
                cnt += 1;
                flag2 = 1;
                now = 1 - now;
            }
        }else{
            if(S[i] == '#'){
                now = 1 - now;
                flag2 = 0;
            }else{
                if(flag2 == 1){
                   cnt += 1; 
                }
            }
        }
    }
    int result = max(cnt1, cnt2);
    cout << result << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: 'cnt' was not declared in this scope; did you mean 'cnt2'?
   25 |                 cnt += 1;
      |                 ^~~
      |                 cnt2
a.cc:35:20: error: 'cnt' was not declared in this scope; did you mean 'cnt2'?
   35 |                    cnt += 1;
      |                    ^~~
      |                    cnt2
Language: C++

#include <algorithm>
#include <cctype>
#include <cstdio>
#include <iostream>
#include <locale>
#include <numeric>
#include <string>
#include <vector>

using namespace std;

int main() {
    cin.tie(0);
    long n;
    string s;
    cin >> n;
    cin >> s;
    long minsharp = n;
    for (long i = 0; i < n; i++) {
        if (s[i] == '#') {
            minsharp = i;
            break;
        }
    }
    long answ = 0;
    for (long i = minsharp; i < n - 1; i++) {
        if (s[i] == '#') answ++;
    }

    minsharp = n;
    for (long i = 0; i < n; i++) {
        if (s[i] == '#') {
            minsharp = i;
            break;
        }
    }

    test long ansb = 0;
    for (long i = minsharp; i < n; i++) {
        if (s[i] != '#') ansb++;
    }

    cout << min(ansb, answ) << endl;
    // cout << answ << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:5: error: 'test' was not declared in this scope
   38 |     test long ansb = 0;
      |     ^~~~
a.cc:40:26: error: 'ansb' was not declared in this scope; did you mean 'answ'?
   40 |         if (s[i] != '#') ansb++;
      |                          ^~~~
      |                          answ
a.cc:43:17: error: 'ansb' was not declared in this scope; did you mean 'answ'?
   43 |     cout << min(ansb, answ) << endl;
      |                 ^~~~
      |                 answ
Language: C++

#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>

// template {{{
using namespace std;

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define fill(x, y) memset(x, y, sizeof(x))

using int64 = long long;

int dx[] = {0, 1, 0, -1};
int dy[] = {-1, 0, 1, 0};

bool in_field(int W, int H, int x, int y) {
  return (0 <= x && x < W) && (0 <= y && y < H);
}

// pair
template <typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) {
  return s << "(" << p.first << ", " << p.second << ")";
}
// vector
template <typename T> ostream &operator<<(ostream &s, const vector<T> &v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1)
      s << "\t";
  }
  return s;
}

// }}}

// url: https://atcoder.jp/contests/tenka1-2019-beginner/tasks/tenka1_2019_c

int N;
string S;

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

  int dot = 0, sharp = 0;
  int ans = 0;

  int j = 0;
  priority_queue<std::tuple<int, std::pair<int, int>, int>> que;
  bool done[10000];
  fill(done, 0);

  rep(i, N) {
    if (S[i] == '#') {
      if (dot != 0) {
        que.push(std::tuple<int, std::pair<int, int>, int>(
            min(sharp, dot), std::pair<int, int>(sharp, dot), j));
        dot = 0;
        sharp = 0;
        j++;
      }
      sharp++;
    }
    if (S[i] == '.') {
      dot++;
    }
  }
  que.push(std::tuple<int, std::pair<int, int>, int>(
      min(sharp, dot), std::pair<int, int>(sharp, dot), j));

  while (!que.empty()) {
    std::tuple<int, std::pair<int, int>, int> p = que.top();
    que.pop();

    // cout << get<0>(p) << " " << get<1>(p) << " " << get<2>(p) << endl;
    if (done[get<2>(p)]) {
      ans += get<1>(p).second;
    } else {
      ans += get<0>(p);
    }
  }

  cout << ans << endl;

  return 0;
}

// vim: foldmethod=marker


Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: 'memset' was not declared in this scope
   13 | #define fill(x, y) memset(x, y, sizeof(x))
      |                    ^~~~~~
a.cc:56:3: note: in expansion of macro 'fill'
   56 |   fill(done, 0);
      |   ^~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <set>
  +++ |+#include <cstring>
    6 | #include <string>
Language: C

   #include <stdio.h>
   #include <string.h>
   
   int main(void)
   {
       int n, k;
       int num = 0;
       char s[256];
       scanf("%d", &n);
       scanf("%s", s);
       bool is_b = false;
       for (int i = 0; i < n; i++) {
           if (s[i] == '.') {
               if (is_b) {
                   num++; 
               }   
               is_b = false;
           } else if (s[i] == '#') {
               is_b = true;
           }
       }
   
       return 0;
   }


Compiler output:
main.c: In function 'main':
main.c:11:8: error: unknown type name 'bool'
   11 |        bool is_b = false;
      |        ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 |    #include <string.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c:11:20: error: 'false' undeclared (first use in this function)
   11 |        bool is_b = false;
      |                    ^~~~~
main.c:11:20: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:11:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:23: error: 'true' undeclared (first use in this function)
   19 |                is_b = true;
      |                       ^~~~
main.c:19:23: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C++

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

int main(){
  int n;
  int count = 0;
  string s;

  cin >> n >> s;

  for(int i = 0;i < n;i++){
    if(s[i] == '#' && s[i+1] == '.' && i != n-1){
      if(s[i-1] == '.' && i != 0){
        count++;
        s[i] = ".";
      }
      else{
        count++;
        s[i+1] = '#';
      }
    }
  }

  cout << count << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:16: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   16 |         s[i] = ".";
      |                ^~~
      |                |
      |                const char*
Language: C++

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

int main() {
	long lopng int N,cnt = 0;
	char shape = '#',dot = '.';
	string S;
	cin >> N >> S;

	for (int i = 0; i < N; i++)
	{
		if( i > 0 ){
		if ( S[i-1] == shape && S[i] == dot ) cnt++;
	}
	}
		cout << cnt << endl;
		return 0;
	}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: expected initializer before 'int'
    8 |         long lopng int N,cnt = 0;
      |                    ^~~
a.cc:11:16: error: 'N' was not declared in this scope
   11 |         cin >> N >> S;
      |                ^
a.cc:16:55: error: 'cnt' was not declared in this scope; did you mean 'int'?
   16 |                 if ( S[i-1] == shape && S[i] == dot ) cnt++;
      |                                                       ^~~
      |                                                       int
a.cc:19:25: error: 'cnt' was not declared in this scope; did you mean 'int'?
   19 |                 cout << cnt << endl;
      |                         ^~~
      |                         int
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
typedef long long int ll;

template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}


#define ARRAY_MAX 100005
const int INF = 1e9 + 7;


int main() {

	int n;
	cin >> n;
	string s;
	cin >> s;
	string t = s;

	int cnt = 0, cnt2 = 0;

	for (int i = 0; i < n - 1; i++)
	{
		if (s[i] == '#' && s[i + 1] == '.')
		{
			s[i + 1] = '#';
			cnt++;
		}
	}

	for (int i = n - 1; i > 0; i--)
	{
		if (t[i] == '.' && t[i - 1] == '#')
		{
			t[i - 1] = '.';
			cnt2++;
		}
	
	cout << min(cnt,cnt2) << endl;
}



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

#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>

// template {{{
using namespace std;

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define fill(x, y) memset(x, y, sizeof(x))

using int64 = long long;

int dx[] = {0, 1, 0, -1};
int dy[] = {-1, 0, 1, 0};

bool in_field(int W, int H, int x, int y) {
  return (0 <= x && x < W) && (0 <= y && y < H);
}

// pair
template <typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) {
  return s << "(" << p.first << ", " << p.second << ")";
}
// vector
template <typename T> ostream &operator<<(ostream &s, const vector<T> &v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1)
      s << "\t";
  }
  return s;
}

// }}}

// url: https://atcoder.jp/contests/tenka1-2019-beginner/tasks/tenka1_2019_c

int N;
string S;

typedef tuple<int, pair<int, int>, int> P;

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

  int dot = 0, sharp = 0;
  int ans = 0;

  int j = 0;
  priority_queue<P> que;
  bool done[10000];
  fill(done, 0);

  rep(i, N) {
    if (S[i] == '#') {
      if (dot != 0) {
        que.push(P(min(sharp, dot), pair<int, int>(sharp, dot), j));
        dot = 0;
        sharp = 0;
        j++;
      }
      sharp++;
    }
    if (S[i] == '.') {
      dot++;
    }
  }
  que.push(P(min(sharp, dot), pair<int, int>(sharp, dot), j));

  while (!que.empty()) {
    P p = que.top();
    que.pop();

    // cout << get<0>(p) << " " << get<1>(p) << " " << get<2>(p) << endl;
    if (done[get<2>(p)]) {
      ans += get<1>(p).second;
    } else {
      ans += get<0>(p);
    }
  }

  cout << ans << endl;

  return 0;
}

// vim: foldmethod=marker


Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: 'memset' was not declared in this scope
   13 | #define fill(x, y) memset(x, y, sizeof(x))
      |                    ^~~~~~
a.cc:58:3: note: in expansion of macro 'fill'
   58 |   fill(done, 0);
      |   ^~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <set>
  +++ |+#include <cstring>
    6 | #include <string>
Language: C++

#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>

// template {{{
using namespace std;

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define fill(x, y) memset(x, y, sizeof(x))

using int64 = long long;

int dx[] = {0, 1, 0, -1};
int dy[] = {-1, 0, 1, 0};

bool in_field(int W, int H, int x, int y) {
  return (0 <= x && x < W) && (0 <= y && y < H);
}

// pair
template <typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) {
  return s << "(" << p.first << ", " << p.second << ")";
}
// vector
template <typename T> ostream &operator<<(ostream &s, const vector<T> &v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1)
      s << "\t";
  }
  return s;
}

// }}}

// url: https://atcoder.jp/contests/tenka1-2019-beginner/tasks/tenka1_2019_c

int N;
string S;

typedef tuple<int, pair<int, int>, int> P;

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

  int dot = 0, sharp = 0;
  int ans = 0;

  int j = 0;
  priority_queue<P> que;
  bool done[10000];
  fill(done, 0);

  rep(i, N) {
    if (S[i] == '#') {
      if (dot != 0) {
        que.push(P(min(sharp, dot), pair<int, int>(sharp, dot), j));
        dot = 0;
        sharp = 0;
        j++;
      }
      sharp++;
    }
    if (S[i] == '.') {
      dot++;
    }
  }
  que.push(P(min(sharp, dot), pair<int, int>(sharp, dot), j));

  while (!que.empty()) {
    P p = que.top();
    que.pop();

    // cout << get<0>(p) << " " << get<1>(p) << " " << get<2>(p) << endl;
    if (done[get<2>(p)]) {
      ans += get<1>(p).second;
    } else {
      ans += get<0>(p);
    }
  }

  cout << ans << endl;

  return 0;
}

/

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: 'memset' was not declared in this scope
   13 | #define fill(x, y) memset(x, y, sizeof(x))
      |                    ^~~~~~
a.cc:58:3: note: in expansion of macro 'fill'
   58 |   fill(done, 0);
      |   ^~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <set>
  +++ |+#include <cstring>
    6 | #include <string>
a.cc: At global scope:
a.cc:93:1: error: expected unqualified-id before '/' token
   93 | /
      | ^
Language: C++

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

int main() {
    long long int n,cnt,cntw,len,est;cin >> n;
    cnt = 0;
    cntw = 0;
    string str;cin >> str;

    for(int m=0;m<n;m++){
        if(str[m]=='.'){
            str.erase(str.begin());
            m=m-1;
        }else{
            break;
        }
    }

    len = str.size();

    for(int j=len-1;j>0;j--){
        if(str[j]=='#'){
            str.pop_back();
        }else{
            break;
        }
    }

    len = str.size();
    for(int i=0;i<len;i++){
        if(str[i]=='#'){
           cnt++;
        }else{
            cntw++;
        }
    }

    est = min(cnt;cntw);

    cout << est << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:18: error: expected ')' before ';' token
   38 |     est = min(cnt;cntw);
      |              ~   ^
      |                  )
a.cc:38:23: error: expected ';' before ')' token
   38 |     est = min(cnt;cntw);
      |                       ^
      |                       ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
    int N;
    cin >> N ;
 
    string S;
    cin >> S;
 
    int cnt = 0;
    for(int i = 0 ; i < N ; i++){
        if(S[i] == '#'){
               for(int j = N-i+1 ; j > i; j--){
                     if(S[j] == '.'){
                          cnt++;
                     }
                }
        goto OUT ;
        }
    }
    OUT:
    cout << cnt << endl;
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
 
int main(){
    int N;
    cin >> N ;
 
    string S;
    cin >> S;
 
    int cnt = 0;
    for(int i = 0 ; i < N ; i++){
        if(S[i] == '#'){
               for(int j = N-i-1 ; j > i; j--){
                     if(S[j] == '.'){
                          cnt++;
                     }
                }
        goto OUT ;
        }
    }
    OUT:
    cout << cnt << endl;
    return 0;
}

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

#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;

int main() {
	int N;
	cin >> N;
	char a[N];
	cin >> a;
	int cnt = 0;
	int cnta = 0;
	for (int i = 0; i < N - 1; i++) {
		if (a[i] == '#') {
			cnta += 1;
		}
	}
	for (int i = 0; i < N-1; i++) {
		if (a[i] == '#') {
			if (a[i+1] == '.') {
				a[i+1] = '#';
				cnt += 1;
			}
		}
	}
	if (cnt <= cnta) {
		cout << cnt << endl;
	}
	else if
	{
		cout << cnta << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: expected '(' before '{' token
   30 |         {
      |         ^
      |         (
Language: C++

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

int main(){
  long long n;
  int flag1=0,flag2=0;  
  string s;
  string black,white;
  cin >> n >> s;
  long long count1=0 , count2=0;
  black = s;
  white = s;
  
  for(long long i=0; i<n; i++){
    if(flag1==0){
      if(black.at(i) == '#'){
        flag1=1;
      }
    }else{
      if(black.at(i) == '.'){
        count1++;
      }
    }
  }
  
  for(long long i=n-1; i => 0; i--){
    if(flag2==0){
      if(white.at(i) == '.'){
        flag2=1;
      }
    }else{
      if(white.at(i) == '#'){
        count2++;
      }
    }
  }

  if(count1 < count2){ 
    cout << count1 << endl;
  }else{
    cout << count2 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:27: error: expected primary-expression before '>' token
   26 |   for(long long i=n-1; i => 0; i--){
      |                           ^
Language: C

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

using namespace std;
//using ll = long long;

int main(){
    int n,c=0, i;
    char s[1000000];
    scanf("%d",&n);
    scanf("%s",s);
    for (i  = 1; i<n;i++){
        if(s[i-1] == '#' && s[i] == '.'){
            c++;
        }
    }
    printf("%d\n",c);
    return 0;
}

Compiler output:
main.c:4:1: error: unknown type name 'using'
    4 | using namespace std;
      | ^~~~~
main.c:4:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    4 | using namespace std;
      |                 ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
char S[N];
for(int i=0;i<N;i++){
cin>>S[i];
}
int cnt=0;
for(int i=0;i<N;i++){
  if(S[i]=='#'){
    cnt = i;
    break;
  }
}
int white =0;
for(int i=cnt;i<N;i++){
  if(S[i]=='.'){
    white++;
  }
}
  int black =0;
for(int i =0;i<N;i++){
  if(S[i]='#'){
    black++;
  }
}
  int B =0;
  
for(int j=N-1;j>-1;j--){
  if(S[j]=='.'){
    B=-1-j;
      break;
  }
  cout<<min(white,black-B);
}

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

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

int main() {
    int N, first_right_white_stone;
    int number_of_black_stone = 0;
    int number_of_white_stone = 0;
    int swap_min = 0;
    string S;
    cin >> N >> S;
    reverse(S.begin(), S.end());
    for (int i = 0; i < N; i++) {
        if (S[i] == '.') {
            first_right_white_stone = i;
            i = N;
        }
    }
    for (int j = first_right_white_stone; j < N; j++) {
        if (S[j] == '#') number_of_black_stone++;
    }

    // 上は白黒または、白のみに染めるやり方
    // 下は黒のみに染めるのが有効かどうかを確認

    for (int k = 0; k < N; k++) {
        if (S[k] == '.') number_of_white_stone++ ;
    }

    swap_min = min(number_of_black_stone, number_of_white_stone);

    cout << swap_min << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'reverse' was not declared in this scope
   12 |     reverse(S.begin(), S.end());
      |     ^~~~~~~
Language: C++

#include <cstdio>
#include <iostream>

#define WHITE '.'
#define BLACK '#'

using namespace std;



int main() {
	int white = 0, black = 0;
	int black_last = 0;
	bool white_flag = false;

	int n;
	char c;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> c;
		s[i] = c;
		if (c == WHITE) {
			if (white_flag) {
				white++;
				black_last = 0;
			}
		}
		else {
			if (!white_flag) {
				white_flag = true;
			}
			black++;
			black_last++;
		}
	}

	black -= black_last;

	int ans = 0;
	white <= black ? ans = white : ans = black;
	cout << ans << endl;
}

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

int A,B,C,D,N,M;
string in;
int main() {
  ios::sync_with_stdio(false);
  cin >> N;
  cin >> in;
  string cp = in;
  int x = 0;
  int y = 0;
  for(int i = 0; i < N; i++){
    if(in[i] == '#') {
      x++;
    }
    else y++;
  }
  x = min(x,y);

  int z = 0;
  int i = N-1;
  while(cp[i] == '#' && i >= 0) {
    z++;
    i--;
  }
  for(int i = 0; i < N-z; i++){
    if(cp[i] == '#') B++;
    else y++;
  }
i = 0;
while(cp[i] == '.' && i < N) {
    z++;
    i++;
  }
  for(int i = z; i < N; i++){
    if(cp[i] == '.') A++;
  }
  A = min(A,B);


  cout << min(x,A);

  return 0;
}

                                                              45,0-1       末尾


Compiler output:
a.cc:2:1: error: 'string' does not name a type
    2 | string in;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:4:3: error: 'ios' has not been declared
    4 |   ios::sync_with_stdio(false);
      |   ^~~
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> N;
      |   ^~~
a.cc:6:10: error: 'in' was not declared in this scope; did you mean 'int'?
    6 |   cin >> in;
      |          ^~
      |          int
a.cc:7:3: error: 'string' was not declared in this scope
    7 |   string cp = in;
      |   ^~~~~~
a.cc:16:7: error: 'min' was not declared in this scope; did you mean 'main'?
   16 |   x = min(x,y);
      |       ^~~
      |       main
a.cc:20:9: error: 'cp' was not declared in this scope
   20 |   while(cp[i] == '#' && i >= 0) {
      |         ^~
a.cc:25:8: error: 'cp' was not declared in this scope
   25 |     if(cp[i] == '#') B++;
      |        ^~
a.cc:29:7: error: 'cp' was not declared in this scope
   29 | while(cp[i] == '.' && i < N) {
      |       ^~
a.cc:34:8: error: 'cp' was not declared in this scope
   34 |     if(cp[i] == '.') A++;
      |        ^~
a.cc:39:3: error: 'cout' was not declared in this scope
   39 |   cout << min(x,A);
      |   ^~~~
a.cc: At global scope:
a.cc:44:63: error: expected unqualified-id before numeric constant
   44 |                                                               45,0-1       末尾
      |                                                               ^~
Language: C++

#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <string>

using namespace std;

#include <iostream>
//#include <fstream>

//ifstream cin ("input.in");
//ofstream cout ("output.out");

//ifstream cin (".in")
//ofstream cout (".out");

static const int NMAX = 2*100005;

string s;
int whites[NMAX];
int blacks[NMAX];

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

	int n;
	cin>>n;
	cin>>s;
 
 	int changes = 0;

 	if ( s[0] == '#' ) {
 		blacks[0] = 1;
 		whites[0] = 0;
 	}

	for ( int i = 1; i < n; ++i ) {
		if ( s[i] == '#' ) {
			blacks[i] = blacks[i-1]+1;
			whites[i] = 0;
		}
	}

	for ( int i = n-1; i >= 0; --i ) {
		if ( s[i] == '.' ) {
			whites[i] = whites[i+1]+1;
			blacks[i] = 0;
		}
	}

	for ( int i = 0; i < n; ++i ) {
		if ( s[i] == '#' && s[i+1] == '.' ) {
			if ( whites[i+1] > blacks[i]  ) {
				int changedToWhite = blacks[i];

				changes += changeToWhite;
				whites[i+1] += changeToWhite;
				
				s[i] = '.';
				blacks[i] = 0;
			} else {
				int changedToBlack = whites[i+1];

				changes += changedToBlack;
				blacks[i+changedToBlack] = blacks[i]+changedToBlack;
				i += changedToBlack+1;

				if ( i > 0 ) {
					s[i-1] = '#';
					whites[i-1] = 0;
				}
			}
		}
	}

	cout<<changes<<'\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:44: error: 'changeToWhite' was not declared in this scope; did you mean 'changedToWhite'?
   59 |                                 changes += changeToWhite;
      |                                            ^~~~~~~~~~~~~
      |                                            changedToWhite
Language: Java

public class Main {

	public static void main(String[] args) {
		int N = 0;
		String S;
		Scanner sc = new Scanner(System.in);
		N = Integer.parseInt(sc.next());
		S = sc.next();
		int result = 0;
		int count = 0;
		for (;;) {
			result = S.indexOf("#.");
			if (result !=-1) {
				S = S.replaceFirst("#.", "##");
				count++;
			}else
				break;
		}
		System.out.println(count);
	}

}

Compiler output:
Main.java:6: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <string>

using namespace std;

#include <iostream>
//#include <fstream>

//ifstream cin ("input.in");
//ofstream cout ("output.out");

//ifstream cin (".in")
//ofstream cout (".out");

static const int NMAX = 2*100005;

string s;
int whites[NMAX];
int blacks[NMAX];

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

	int n;
	cin>>n;
	cin>>s;
 
 	int changes = 0;

 	if ( s[0] == '#' ) {
 		blacks[0] = 1;
 		whites[0] = 0;
 	}

	for ( int i = 1; i < n; ++i ) {
		if ( s[i] == '#' ) {
			blacks[i] = blacks[i-1]+1;
			whites[i] = 0;
		}
	}

	for ( int i = n-1; i >= 0; --i ) {
		if ( s[i] == '.' ) {
			whites[i] = whites[i+1]+1;
			blacks[i] = 0;
		}
	}

	for ( int i = 0; i < n; ++i ) {
		if ( s[i] == '#' && s[i+1] == '.' ) {
			if ( whites[i+1] > blacks[i]  ) {
				int changedToWhite = blacks[i];

				changes += changeToWhite;
				whites[i+1] += changeToWhite;
				
				s[i] = '.';
				blacks[i] = 0;
			} else {
				int changedToBlack = whites[i+1];

				changes += changedToBlack;
				blacks[i+changedToBlack] = blacks[i]+changedToBlack;
				i += changedToBlack+1;

				s[i-1] = '#';
				whites[i-1] = 0;
			}
		}
	}

	cout<<changes<<'\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:44: error: 'changeToWhite' was not declared in this scope; did you mean 'changedToWhite'?
   59 |                                 changes += changeToWhite;
      |                                            ^~~~~~~~~~~~~
      |                                            changedToWhite
Language: C

#include <stdio.h>

int main(void){
    int N,i,C=0;
    char S[];

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

    for(i=1;i<N;i++){
        if(S[i] != S[i-1] && S[i-1] == '#'){
            C=C+1;
        }
    }
    printf("%d\n",C);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:10: error: array size missing in 'S'
    5 |     char S[];
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
/*int unchi(){
	int N;
	string S;
	cin >> N >> S;
	int boarder = 0;
	int min = 0;
	for(int i = 0; i <= N; i++){
		int count = 0;
		for(int j = 0; j < N; j++){
			if(i <= j){
				if(S[i] != '.')
					count++;
			}else{
				if(S[i] != '#')
					count++;
			}
		}
		if(min > count)
			min = count;
	}
	cout << min << endl;
}*/

int main(){
	int N;
	string S;
	cin >> N >> S;
	vector<int> sdat(N);
	int tmp = 0;
	char c = '.'
	for(int i = 0; i < N; i++){
		if(S[i] != c){
			c = S[i];
			tmp++;
		}
		sdat[tmp]++;
	}
	int boarder = 0;
	int min = 0;
	for(int i = 0; i <= sdat.size(); i++){
		int count = 0;
		for(int j = 0; j < sdat.size(); j++){
			if(i > j){
				if(sdat[j]%2)
					count += sdat[j];
			}else{
				if(sdat[j]%2-1)
					count += sdat[j];
			}
			if(min > count)
				min = count;
		}
	}
	cout << min << endl;
}

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

import java.util.Scanner;

public class C {

	private static final char WHITE = '.';
	private static final char BLACK = '#';

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			String s = scanner.next();

			int b = 0;
			int b2w = 0;
			char[] cs = s.toCharArray();
			for (int i = 0, max = n - 1; i < max; i++) {
				char current = cs[i];
				char next = cs[i + 1];
				if (current == BLACK) {
					b++;
				}
				if (!(current == BLACK && next == WHITE)) {
					continue;
				}
				b2w += b;
				b = 0;
			}
			int w2b = 0;
			for (int i = 0, max = n - 1; i < max; i++) {
				char current = cs[i];
				char next = cs[i + 1];
				if (!(current == BLACK && next == WHITE)) {
					continue;
				}
				cs[i + 1] = BLACK;
				w2b++;
			}
			System.out.println(Math.min(b2w, w2b));
		}
	}

}


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

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

int main(){
  long long count = 0,cou = 0,c = 0, N,a;
  string S;
  cin >> N >> S;
  for(long long i = 0; i < N; i++){
    if(S.at(i) == '#'){
      for(long long j = i; j < N; j++){
        if(S.at(j) == '.'){
          count++;
        }
        else{
          cou++;
        }
      }
      break;
    }
    if(S.at(N) == '#'){
      cou -= 1;
    }
  }
  c = N - cou;
  a= min(count,cou);
  a= min(a,c);
  a= max(a,0);
  cout << a;
}

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

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

int main(){
  long long count = 0,cou = 0,c = 0, N,a;
  string S;
  cin >> N >> S;
  for(long long i = 0; i < N; i++){
    if(S.at(i) == '#'){
      for(long long j = i; j < N; j++){
        if(S.at(j) == '.'){
          count++;
        }
        else{
          cou++;
        }
      }
      break;
    }
    if(S.at(N) == '#'){
      cou -= 1;
    }
  }
  c = N - cou;
  a= min(count,cou);
  a= min(a,c);
  a= max(a,0)
  cout << a;
}

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

import java.util.Scanner;

public class C {

	private static final char WHITE = '.';
	private static final char BLACK = '#';

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			String s = scanner.next();

			int b = 0;
			int b2w = 0;
			char[] cs = s.toCharArray();
			for (int i = 0, max = n - 1; i < max; i++) {
				char current = cs[i];
				char next = cs[i + 1];
				if (current == BLACK) {
					b++;
				}
				if (!(current == BLACK && next == WHITE)) {
					continue;
				}
				b2w += b;
			}
			int w2b = 0;
			for (int i = 0, max = n - 1; i < max; i++) {
				char current = cs[i];
				char next = cs[i + 1];
				if (!(current == BLACK && next == WHITE)) {
					continue;
				}
				cs[i + 1] = BLACK;
				w2b++;
			}
			System.out.println(Math.min(b2w, w2b));
		}
	}

}


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

#include<stdio.h>
int main(){
	int x,i,a=0,b=0,j;
	char s[1000000];
	scanf("%d %s",&x,s);
	for(i=0;i<x;i++){
		if(s[i]=='*')a++';
		else b++;
	}
	if(a>b)printf("%d\n",b);
	else printf("%d\n",a);
	
	
} 

Compiler output:
main.c: In function 'main':
main.c:7:33: warning: missing terminating ' character
    7 |                 if(s[i]=='*')a++';
      |                                 ^
main.c:7:33: error: missing terminating ' character
    7 |                 if(s[i]=='*')a++';
      |                                 ^~
main.c:7:33: error: expected ';' before 'else'
    7 |                 if(s[i]=='*')a++';
      |                                 ^
      |                                 ;
    8 |                 else b++;
      |                 ~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
    long N,cnt1 = 0 cnt2 = 0;
    string S;
    cin >> N >> S;

    //普通に隣り合うの探索したら間に合わなかった
    //##.#のときアウト
   for(long i = 0; i < N; i++){
        if(S[i] == '#' ){
     
            cnt1++;
        }
        if(S[i] == '.')
            cnt2++;
    }


    if(cnt1 <= cnt2){
        cout << cnt1 << endl;
    }
    if(cnt1 > cnt2){
        cout << cnt2 << endl;
    }

    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: expected ',' or ';' before 'cnt2'
    6 |     long N,cnt1 = 0 cnt2 = 0;
      |                     ^~~~
a.cc:18:13: error: 'cnt2' was not declared in this scope; did you mean 'cnt1'?
   18 |             cnt2++;
      |             ^~~~
      |             cnt1
a.cc:22:16: error: 'cnt2' was not declared in this scope; did you mean 'cnt1'?
   22 |     if(cnt1 <= cnt2){
      |                ^~~~
      |                cnt1
a.cc:25:15: error: 'cnt2' was not declared in this scope; did you mean 'cnt1'?
   25 |     if(cnt1 > cnt2){
      |               ^~~~
      |               cnt1
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		long n = sc.nextLong();
		// 文字列の入力
		String s = sc.next();
		String[] S = s.split("");
		long i = 0;
		long count = 0;

		for(;i<n;i++){
			if(S[i].equals("#"))break;
		}

		for(;i<n;i++){
			if(S[i].equals("."))count++;
		}

		// 出力
		System.out.println(count);
	}
}

Compiler output:
Main.java:15: error: incompatible types: possible lossy conversion from long to int
			if(S[i].equals("#"))break;
			     ^
Main.java:19: error: incompatible types: possible lossy conversion from long to int
			if(S[i].equals("."))count++;
			     ^
2 errors
Language: Java

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        String S = sc.next();
        String[] ss = S.split("");

        // 左から見ていく戦法
        int result1 = 0;
        for (int i = 0; i < N-1; i++) {
            if (ss[i].equals("#") && ss[i+1].equals(".")) {
                ss[i+1] = "#";
                result1++;
            }
        }

        ss = S.split("");
        // 右から見ていく戦法
        int result2 = 0;
        for (int i = N-1; i > 0; i--) {
            if (ss[i].equals(".") && ss[i-1].equals("#")) {
                ss[i-1] = ".";
                result2++;
            }

        }

        System.out.println(result1 < result2 ? result1 : result2);
    }
}

Compiler output:
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

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

int main() {
    int n;
    string s;
    cin >> n >> s;
    int c1 = 0;
    for (int i = 0; i < n; i++) {
        if (s[i] == '#' && s[i + 1] == '.') {
            if (i + 2 > n) {
                cnt++;
            } else {
                if (s[i + 2] == '.') {
                    s[i] = '.';
                } else {
                    s[i + 1] = '#';
                }
            }
        }
    }
    cout << cnt << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   13 |                 cnt++;
      |                 ^~~
      |                 int
a.cc:23:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
   23 |     cout << cnt << endl;
      |             ^~~
      |             int
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		long n = sc.nextInt();
		// 文字列の入力
		String s = sc.next();
		String[] S = s.split("");
		long i = 0;
		long count = 0;

		for(;i<n;i++){
			if(S[i].equals("#"))break;
		}

		for(;i<n;i++){
			if(S[i].equals("."))count++;
		}

		// 出力
		System.out.println(count);
	}
}

Compiler output:
Main.java:15: error: incompatible types: possible lossy conversion from long to int
			if(S[i].equals("#"))break;
			     ^
Main.java:19: error: incompatible types: possible lossy conversion from long to int
			if(S[i].equals("."))count++;
			     ^
2 errors