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

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

int main(){
    int n,b=0,w=0,z=0;
    bool black=false;
    string s;
    cin>>n>>s;
    REP(i,n){
        if(s[i]-'.'==0 && black==true){
            w++;
            b+=z;
            z=0;
        }
        else if(s[i]-'#'==0){
            black=true;
            z++;
        }
    cout<<min(b,w)<<endl;
}

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

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <set>
#include <map>

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define for_p(i, a, b) for(int i = a; i < b; i++)
#define for_m(i, a, b) for(int i = a - 1; i >= b; i--)

//a = s1.size();
//vector<string> s1;
//string s2 = accumulate( s1.begin(), s1.end(), string() );

using namespace std;

int main()
{
  int a = 0 , b = 0, c = 0, d = 0, e = 0, f = 0;
  int i = 0, j = 0;
  double d1 = 0, d2 = 0, d3 = 0, d4 = 0, d5 = 0, d6 = 0;
  int a1[256], a2[512], a3[1024];
  //char s1[200000], s2[200000], s3[200000];
  string s1, s2, s3;
  
  cin >> a >> s1;
  
  for(i = 0; i < a - 1; i++){
    if(s1[i] == '#' && s1[i] == "."){
      b++;
    }
  }
  cout << b << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:37:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   37 |     if(s1[i] == '#' && s1[i] == "."){
Language: C++

#include<stdio.h>

int main(){
	int N,ans(-1);
  	scanf("%d",&N);
  	char isi[N];
  	scanf("%s",isi);
  	for(int i = 0 ; i < N ; i ++){
    	if(isi[i] == "#") ans = 0;
      	if(isi[i] == "." && ans >= 0) ans ++;
    }
  	printf("%d\n",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |         if(isi[i] == "#") ans = 0;
      |            ~~~~~~~^~~~~~
a.cc:10:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if(isi[i] == "." && ans >= 0) ans ++;
      |            ~~~~~~~^~~~~~
Language: C++

#include "bits/stdc++.h"
#define ll long long
#define ALL(x) x.begin(),x.end()
#define MOD (1000000000+7)
using namespace std;


int main(){
ll N;
string s;
cin>>N>>s;

ll nai=-100;
for(ll i=0;i<N;i++){s
  if(s[i]=='#'){
    nai = i;
    break;
  }
}

if(nai==-100){
cout<<0<<endl;
return 0;
}

ll allb=0;

for(ll i=nai;i<N;i++){
  if(s[i]=='.'){
    allb++;
  } 
}


ll tmp = allb;

char now = '#';
for(ll i=nai;i<N;i++){

  if(now!=s[i]){
    if(tmp<allb){
      allb=tmp;
    }
  }


  if(s[i]=='#'){
    tmp++;
    now = s[i];
  } 
  else if(s[i]=='.'){
    tmp--;
        now = s[i];

  }
}



cout<<allb<<endl;


}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: expected ';' before 'if'
   14 | for(ll i=0;i<N;i++){s
      |                      ^
      |                      ;
   15 |   if(s[i]=='#'){
      |   ~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string a;
  int c=0,b=0,d,e=1;
  cin>>d>>a;
  for(int i=0;i<d;i++){
    if(a[i]=="#") e=1;
    if(e&&a[i]==".") c++;
  }
  e=0;
  for(int i=d-1;i>=0;i--){
    if(a[i]==".") e=1;
    if(e&&a[i]=="#") b++;
  }
  cout<<min(c,b)<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |     if(a[i]=="#") e=1;
a.cc:9:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if(e&&a[i]==".") c++;
a.cc:13:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |     if(a[i]==".") e=1;
a.cc:14:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(e&&a[i]=="#") b++;
Language: C++

#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
#define pb push_back
#define mp make_pair
#define F .first
#define S .second 
using ll=long long;
using ld=long double;
using namespace std;
const ll mod=1e9+7;
int main(){
  ll n,w=0,b=0,x=0,y=0;
  cin>>n;
  string s;
  cin>>s;
  irep(i,s.length()-1,0)if(s[i]=='#'){x=i;}
  irep(i,s.length(),x)if(s[i]=='.')w++;
  rep(i,0,s.length())if(s[i]=='.'){x=i;}
  rep(i,0,x+1)if(s[i]=='#')b++;
  cout<#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
#define pb push_back
#define mp make_pair
#define F .first
#define S .second 
using ll=long long;
using ld=long double;
using namespace std;
const ll mod=1e9+7;
int main(){
  ll n,w=0,b=0,x=0,y=0;
  cin>>n;
  string s;
  cin>>s;
  irep(i,s.length()-1,0)if(s[i]=='#'){x=i;}
  irep(i,s.length(),x)if(s[i]=='.')w++;
  rep(i,0,s.length())if(s[i]=='.'){x=i;}
  rep(i,0,x+1)if(s[i]=='#')b++;
  cout<<min(w,b);
}
<min(w,b);
}


Compiler output:
a.cc:21:8: error: stray '#' in program
   21 |   cout<#include <bits/stdc++.h>
      |        ^
a.cc: In function 'int main()':
a.cc:21:9: error: 'include' was not declared in this scope
   21 |   cout<#include <bits/stdc++.h>
      |         ^~~~~~~
a.cc:21:18: error: 'bits' was not declared in this scope
   21 |   cout<#include <bits/stdc++.h>
      |                  ^~~~
a.cc:21:23: error: 'stdc' was not declared in this scope; did you mean 'std'?
   21 |   cout<#include <bits/stdc++.h>
      |                       ^~~~
      |                       std
a.cc:28:1: error: expected primary-expression before 'using'
   28 | using ll=long long;
      | ^~~~~
a.cc:32:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   32 | int main(){
      |         ^~
a.cc:32:9: note: remove parentheses to default-initialize a variable
   32 | int main(){
      |         ^~
      |         --
a.cc:32:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:32:11: error: a function-definition is not allowed here before '{' token
   32 | int main(){
      |           ^
a.cc:43:1: error: expected primary-expression before '<' token
   43 | <min(w,b);
      | ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
using ll=long long;
int main(){
  ll n,w=0,b=0,x=0;
  cin>>n;
  string s;
  cin>>s;
  rep(i,0,s.length())if(s[i]=='#')x=i;
  rep(i,0,x+1)if(s[i]=='#')w++;
  rep(i,0,s.length())if(s[i]=='.')b++;
  cout<<min(w,b);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'string' was not declared in this scope
    7 |   string s;
      |   ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:8:8: error: 's' was not declared in this scope
    8 |   cin>>s;
      |        ^
a.cc:12:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |   cout<<min(w,b);
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:9: error: 'min' was not declared in this scope; did you mean 'std::min'?
   12 |   cout<<min(w,b);
      |         ^~~
      |         std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: C++

    #include<iostream>
    using namespace std;
     
    int main(){
      int n; cin >> n;
      string s; cin >> x;
      int pnt = 0;
      for(int i = 0; i < n; ++i){
        if(s[i] == '#')pnt++;
      }
      int ans;
      for(int i = n - 1; i >= 0; --i){
        if(s[i] == '.')pnt++;
        else pnt--;
      }
      if(ans < pnt)ans = pnt;
      cout << ans << endl;
      return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: 'x' was not declared in this scope
    6 |       string s; cin >> x;
      |                        ^
Language: C++

include<iostream>
using namespace std;

int main(){
  int n; cin >> n;
  string s; cin >> x;
  int pnt = 0;
  for(int i = 0; i < n; ++i){
    if(s[i] == '#')pnt++;
  }
  int ans;
  for(int i = n - 1; i >= 0; --i){
    if(s[i] == '.')pnt++;
    else pnt--;
  }
  if(ans < pnt)ans = pnt;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:10: error: 'cin' was not declared in this scope
    5 |   int n; cin >> n;
      |          ^~~
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string s; cin >> x;
      |   ^~~~~~
a.cc:6:20: error: 'x' was not declared in this scope
    6 |   string s; cin >> x;
      |                    ^
a.cc:9:8: error: 's' was not declared in this scope
    9 |     if(s[i] == '#')pnt++;
      |        ^
a.cc:13:8: error: 's' was not declared in this scope
   13 |     if(s[i] == '.')pnt++;
      |        ^
a.cc:17:3: error: 'cout' was not declared in this scope
   17 |   cout << ans << endl;
      |   ^~~~
a.cc:17:18: error: 'endl' was not declared in this scope
   17 |   cout << ans << endl;
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
 
 
int main(){
  int N;
  string S;
  cin>>N>>S;
 
  int dot=0;
  //累積和
  int dotcount[200010]={0};
  int sharpcount[200010]={0};
  for(int i=0;i<N;i++){
    if(S[i]=='.')  dot++;
    dotcount[i+1]=dot;
    sharpcount[i+1]=i+1-dot;
  }
 
  int ans=10e6+1;
  for(int i=0;i<=N;i++){
    
    ans=min(ans,sharpcount[i]+dotcount[N]-dotcount[i]);
  }
  cout<<ans<<endl;
 
  return 0;
}
#include <bits/stdc++.h>
using namespace std;
using ll=long long;


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

  int dot=0;
  //累積和
  int dotcount[200010]={0};
  int sharpcount[200010]={0};
  for(int i=0;i<N;i++){
    if(S[i]=='.')  dot++;
    dotcount[i+1]=dot;
    sharpcount[i+1]=i+1-dot;
  }

  int ans=10e6+1;
  for(int i=0;i<=N;i++){
    
    ans=min(ans,sharpcount[i]+dotcount[N]-dotcount[i]);
  }
  cout<<ans<<endl;

  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
 
 
int main(){
  int N;
  string S;
  cin>>N>>S;
 
  int dot=0;
  int dotcount[200010]={0};
  int sharpcount[200010]={0};
  for(int i=0;i<N;i++){
    if(S[i]=='.')  dot++;
    dotcount[i+1]=dot;
    sharpcount[i+1]=i+1-dot;
  }
 
  int ans=10e6+1;
  for(int i=0;i<=N;i++){
    
    ans=min(ans,sharpcount[i]+dotcount[N]-dotcount[i]);
  }
  cout<<ans<<endl;
 
  return 0;
}
#include <bits/stdc++.h>
using namespace std;
using ll=long long;


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

  int dot=0;
  //累積和
  int dotcount[200010]={0};
  int sharpcount[200010]={0};
  for(int i=0;i<N;i++){
    if(S[i]=='.')  dot++;
    dotcount[i+1]=dot;
    sharpcount[i+1]=i+1-dot;
  }

  int ans=10e6+1;
  for(int i=0;i<=N;i++){
    
    ans=min(ans,sharpcount[i]+dotcount[N]-dotcount[i]);
  }
  cout<<ans<<endl;

  return 0;
}


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

#include <stdio.h>

int main(void){
  int n,count = 0,count1 = 0;
  
  scanf("%d",&n);
  char s;
  int flag[n];
  int i;
  int u = 0;
  
  for(i = 0;i < n;i++){
   scanf(" %c",&s);
    if(s == '#'){
     flag[i] = 1;
      u++;
    }else{
     flag[i] = 0;
    }
  }
  
  for(i = 0;i < n;i++){
    if(flag[i] == 1){
      break;
    }
  }
  
  for(int m = i;m < n;m++){
    if(flag[m] == 0){
      count++;
    }
  }
  
  for(m = (n -1);m >= 0;m--){
    if(flag[m] == 0){
      break;
    }
    u--;
  }
  
  if(count < u){
  printf("%d\n",count);
  }else{
   printf("%d\n",u);
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:34:7: error: 'm' undeclared (first use in this function)
   34 |   for(m = (n -1);m >= 0;m--){
      |       ^
main.c:34:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    var a = readLine()!!
    var cnt = 0
    for (i in 0 until n - 2) {
        if (a[i] == '#' && a[i + 1] == '.') {
            cnt ++
        }
    }
    if (a[n - 2] == '#' && a[n - 1] == '.') {
        cnt ++
    }
    println(cnt)
}

Compiler output:
a.cc:1:1: error: 'fun' does not name a type
    1 | fun main(args: Array<String>) {
      | ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  string s;
  cin>>n;
  cin>>s;
  int c=0,t=0;
  for(int i=0;i<n;i++)
  {
    if(s[i]=='.') c++;
  }
  t=c;
  for(i=0;i<n;i++)
  {
    if(s[i]=='#') c++;
    else c--;
    if(c<t) t=c;
  }
  cout<<t;
  return 0;
}

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

#include<stdio.h>

int max(int a,int b){
  if(a>b) return b;
  return ;
}
 
int main(void){
  int n,i;
  int tmp,answer;
  scanf("%d",&n);
  
  char s[n];
  
  int a[n],b[n];
  
  for(i=0;i<n;i++){
    a[i]=0;
    b[i]=0;
  }
  
  scanf("%s",s);
  
  if(s[0]=='#') a[0]=1;
  if(s[n-1]=='.') b[n-1]=1;
  
  for(i=1;i<n;i++){
    if(s[i]=='#') 
      a[i]=a[i-1]+1;
    else a[i]=a[i-1];
    
    if(s[n-1-i]=='.')
      b[n-1-i]=b[n-i]+1;
    else b[n-1-i]=b[n-i];
  }
  
  for(i=0;i<n;i++) 
    answer=max(answer,a[i]+b[i]-1);
  
  printf("%d",answer);
  
  return 0;
}

Compiler output:
a.cc: In function 'int max(int, int)':
a.cc:5:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
    5 |   return ;
      |   ^~~~~~
Language: C

#include<stdio.h>
int main()
{ 
  int n,i,j,wsum=0,bsum;
  scanf("%d",&n);
  char u[n];
  for(i=0;i<n;i++)
    scanf("%s",&u[i]);
  for(i=0;i<n;i++)
    if(u[i]=='#') break;
  for(j=i+1;j<n;j++)
    if(u[j]=='.') bsum++;
  
  for(i=n-1;i>=0;i--)
    if(u[i]=='.') break;
  for(j=i-1;j>0n;j--)
    if(u[j]=='#') wsum++;
  
  if(wsum<bsum) printf("%d",wsum);
    else printf("%d",bsum);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:15: error: invalid suffix "n" on integer constant
   16 |   for(j=i-1;j>0n;j--)
      |               ^~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
 
int main(void) {
  int N, start, end, initial_black, initial_white, black, white;
  char *S;
  scanf("%d",&N);
  S = (char*)malloc(sizeof(char)*(N+1));
  assert(S);
  for (start = 0, scanf("%s",S); start < N && S[start] == '.'; start++);
  for (end = N-1; end >= 0 && S[end] == '#'; end--);
  if (end < start) {
    putchar('0');
    free(S);
    return 0;
  }
  for (initial_black = 0; S[start] == '#'; start++, initial_black++);
  for (initial_white = 0; S[start] == '.'; start++, initial_white++);
  for (black = 0, white = 0; start <= end; start++) {
    if (S[i] == '.') {
      white += 1;
    } else {
      black += 1;
    }
  }
  if (initial_black+white < initial_white+white && initial_black+white < initial_black+black) {
    printf("%d",initial_black+white);
  } else if (initial_black+black < initial_white+white && initial_black+black < initial_black+white) {
    printf("%d",initial_black+black);
  } else {
    printf("%d",initial_white+white);
  }
  free(S);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:11: error: 'i' undeclared (first use in this function)
   21 |     if (S[i] == '.') {
      |           ^
main.c:21:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int main(void) {
  int N, i, start, end, black, white;
  char *S;
  scanf("%d",&N);
  S = (char*)malloc(sizeof(char)*(N+1));
  assert(S);
  for (start = 0, scanf("%s",S); start < n && S[start] == '.'; start++);
  for (end = n-1; end >= 0 && S[end] == '#'; end--);
  for (i = start, black = 0, white = 0; i <= end; i++) {
    if (S[i] == '.') {
      white += 1;
    } else {
      black += 1;
    }
  }
  if (end < start) {
    putchar('0');
  } else if (black < white) {
    printf("%d",black);
  } else {
    printf("%d",white);
  }
  free(S);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:42: error: 'n' undeclared (first use in this function)
   11 |   for (start = 0, scanf("%s",S); start < n && S[start] == '.'; start++);
      |                                          ^
main.c:11:42: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
using namespace std;

int main() {
    int N;
    string S;
    cin >> N;
    cin >> S;
    int left_black = 0, right_white = count(S.begin(), S.end(), '.'), min_change = left_black + right_white;
    for (int i = 0; i < N; i++) {
        if (S[i] == '#') left_black++;
        else right_white--;
        min_change = min(min_change, left_black + right_white);
    }
    cout << min_change << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:39: error: 'count' was not declared in this scope
    9 |     int left_black = 0, right_white = count(S.begin(), S.end(), '.'), min_change = left_black + right_white;
      |                                       ^~~~~
a.cc:13:9: error: 'min_change' was not declared in this scope
   13 |         min_change = min(min_change, left_black + right_white);
      |         ^~~~~~~~~~
a.cc:15:13: error: 'min_change' was not declared in this scope
   15 |     cout << min_change << endl;
      |             ^~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
    int N;
    string S;
    cin >> N;
    cin >> S;
    int left_black = 0, right_white = count(S.cbegin(), S.cend(), '.'), min_change = left_black + right_white;
    for (int i = 0; i < N; i++) {
        if (S[i] == '#') left_black++;
        else right_white--;
        min_change = min(min_change, left_black + right_white);
    }
    cout << min_change << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:39: error: 'count' was not declared in this scope
    9 |     int left_black = 0, right_white = count(S.cbegin(), S.cend(), '.'), min_change = left_black + right_white;
      |                                       ^~~~~
a.cc:13:9: error: 'min_change' was not declared in this scope
   13 |         min_change = min(min_change, left_black + right_white);
      |         ^~~~~~~~~~
a.cc:15:13: error: 'min_change' was not declared in this scope
   15 |     cout << min_change << endl;
      |             ^~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
int main(void){
    int n,ans=0,ans2=0;
    char s[200100];
   cin >> n >> s;
   
   int brack=0,white=0;
   
   for(int i=0;i<n;i++){
   		if(s[i]=='#')brack++;
   		else white++;
   		}
   for(; ans<n;ans++){
   		if(s[ans]=='.')break;
   		}
	for(; ans2<n;ans2++){
   		if(s[n-ans2-1]=='#')break;
   		}   
   cout <<min(white-ans2, brack-ans1); 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:33: error: 'ans1' was not declared in this scope; did you mean 'ans2'?
   20 |    cout <<min(white-ans2, brack-ans1);
      |                                 ^~~~
      |                                 ans2
Language: C++

#include <iostream>
using namespace std;
int main(void){
    int n,ans=0,ans2=0;
    char s[200100];
   cin >> n >> s;
   for(; ans<n;ans++){
   		if(s[ans]==`.`)break;
   		}
	for(; ans2<n;ans2++){
   		if(s[ans2]==`.`)break;
   		}   
   cout <<min(n-ans2, n-ans); 
}

Compiler output:
a.cc:8:28: error: stray '`' in program
    8 |                 if(s[ans]==`.`)break;
      |                            ^
a.cc:8:30: error: stray '`' in program
    8 |                 if(s[ans]==`.`)break;
      |                              ^
a.cc:11:29: error: stray '`' in program
   11 |                 if(s[ans2]==`.`)break;
      |                             ^
a.cc:11:31: error: stray '`' in program
   11 |                 if(s[ans2]==`.`)break;
      |                               ^
a.cc: In function 'int main()':
a.cc:8:29: error: expected primary-expression before '.' token
    8 |                 if(s[ans]==`.`)break;
      |                             ^
a.cc:8:31: error: expected unqualified-id before ')' token
    8 |                 if(s[ans]==`.`)break;
      |                               ^
a.cc:11:30: error: expected primary-expression before '.' token
   11 |                 if(s[ans2]==`.`)break;
      |                              ^
a.cc:11:32: error: expected unqualified-id before ')' token
   11 |                 if(s[ans2]==`.`)break;
      |                                ^
Language: C++

/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Apolloliu
 */
 
#include <iostream>
#include <fstream>
 
#include <bits/stdc++.h>
 
using namespace std;
 
#define MEM(a,b)    memset(a, b, sizeof(a))
#define UN(a)       sort(all(a)), a.erase(unique(all(a)), a.end())
#define REV(a)      reverse(all(a))
#define MP(a, b)    make_pair(a, b)
#define PAIR(a, b)  pair<int, int>(a, b)
 
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, int> pii;
 
const int MOD = 1e9 + 7;
const int maxn = 1;
const double EPS = 1e-8;
 
class CStones {
public:
    void solve(std::istream& in, std::ostream& out) {
        int n;
        string s;
        in>>n>>s;
        int res = n;
        std::vector<int> sumw(n, 0), sumb(n, 0);
        for(int i = 0; i < n; ++i){
            if(s[i] == '.'){
                sumw[i] = 1;
            }
            else {
                sumb[i] = 1;
            }
            if(i){
                sumw[i] += sumw[i-1];
                sumb[i] += sumb[i-1];
            }
        }
        if(n >= 2) {
            for (int i = 1; i < n; ++i) {
                if (s[i] != s[i - 1]) {
//                    res = min(res, sumb[i] + sumw[n-1] - sumw[i]);
                    res = min(res, sumb[i-1] + sumw[n-1] - sumw[i-1]);
                }
            }
        }
//        cerr << sumb[n-1] << ' ' << sumw[n-1] << endl;
        res = min(res, min(n-sumb[n-1], n-sumw[n-1]));
        out<<res<<endl;
    }
};

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
using namespace std:

int main(){
  int N;
  string S;
  cin >> N >> S;
  int cnt=0;
  
  for (int i=0;i<N-1;i++){
    if (S[i]=='#' and S[i+1] == '.')cnt++;
  }
  cout << cnt << endl;
}
    

Compiler output:
a.cc:6:20: error: expected ';' before ':' token
    6 | using namespace std:
      |                    ^
      |                    ;
a.cc:6:20: error: expected unqualified-id before ':' token
Language: C

#include<stdio.h>
 
int main(void){
	int N,i,j,w_count=0,b_count=0,flag=0,ans,temp;
	char S[200000];
	scanf("%d \n %s",&N,S);
	for(i=0;i<N;i++){
		if(S[i]=='#' && S[i+1]=='.' && flag==0){
			flag=1;
            temp=i;
			i++;
		}
		if(flag==1 && S[i]=='.'){
			w_count++;
		}else if(flag==1 && S[i]=='#'){
			b_count++;
		}
	}
	
	if(w_count >= b_count){
		ans=b_count;
	}else{
      for(i=temp;i<N;i++){
        if(S[i]=='#' && S[i+1]=='.'){
          ans++;
        }
      }
	}
	
	printf("%d",ans);
	return 0;
}v

Compiler output:
main.c:32:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
   32 | }v
      | ^
Language: C++

/*
 Author : Bisma
 @ copy from bisma template 1.0
 */
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <iomanip>
#include <fstream>
#include <cstdio>
using namespace std;
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define repn(a,b,c) for(int a=b; a>=c; a--)
#define ll long long
#define mem(a, b) memset(a, (b), sizeof(a))
#define loop(a,b,c) for(int a = b ;a<c;a++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;

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;
}

void fast(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
}



int main(){
    fast();

    ll n;

    string s,a;

    s = "0";
    cin>>n;
    cin>>a;

    s+=a;

    ll ans = 0;
    ll pos = n+1 ;
    rep(i,1,n){

        if(s[i] == '#'){
            pos = i;
            break;
        }
     
    }

    rep(i,pos,n) if(s[i]=='.') ans++;

    ans = min(ans , n - ans);

    ll res = 0;

    pos = 0;

    repn(i,n,1){
        if(s[i] == '.'){
            pos = i;
            break;
        }
    }

    repn(i,pos,1){
        if(s[i] == '#') res++;
    }

    res = min(res , n - res);

    ans = min(ans , res)

    cout<<ans<<endl;

    return 0;
    
}
 






Compiler output:
a.cc: In function 'int main()':
a.cc:106:25: error: expected ';' before 'cout'
  106 |     ans = min(ans , res)
      |                         ^
      |                         ;
  107 | 
  108 |     cout<<ans<<endl;
      |     ~~~~
Language: C++

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

int main(){
  int N;
  std::string str;
  std::cin>>N;
  std::cin>>str;
  int dotcount=0;
  int shapecount = 0;
  int totalcount = 0;
  std::vector<int> v;

  for(int i = 1;i<N;i++ ){
    for(int k=0;k<i;k++){
      if(str[k]=='#') shapecount++;
    }
    for(int k=i ; k<N ;k++){
      if(str[k]=='.') dotcount++;
    }
    v.push_back(shapecount+dotcount);
    shapecount=0; dotcount=0;
  }
  for(int i = 0; i < N ; i++ ){
    if(str[i]=='#') shapecount++;
  }
  v.push_back(shapecount);
  int min = *std::min_element(v.begin(),v.end());
  std::cout<<min<<std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: 'vector' is not a member of 'std'
   13 |   std::vector<int> v;
      |        ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <algorithm>
  +++ |+#include <vector>
    4 | 
a.cc:13:15: error: expected primary-expression before 'int'
   13 |   std::vector<int> v;
      |               ^~~
a.cc:22:5: error: 'v' was not declared in this scope
   22 |     v.push_back(shapecount+dotcount);
      |     ^
a.cc:28:3: error: 'v' was not declared in this scope
   28 |   v.push_back(shapecount);
      |   ^
Language: Java

import java.util.*;

public class Main{
  public static void main(String arg[]){
    Scanner stdIn = new Scanner(System.in);
    
    int N = stdIn.nextInt();
    String S = stdIn.next();
    
    int ans = N;
    int leftBlack[N];
    int rightWhite[N];
    for(int i = 0; i < N; i++){
      leftBlack[i] = 0;
      rightWhite[i] = 0;
    }
    for(int i = 0; i < N; i++){
      if((S.charAt(i)) == "#"){
        leftBlack[i]++;
      }
      else if((S.charAt(i)) == "."){
        for(int j = i+1; j < N; j++){
          rightWhite[j]++;
        }
      }
    }
    
    for(int i = 0; i < N; i++){
    	if(ans > (leftBlack[i] + rightWhite[i])){
          ans = leftBlack[i] + rightWhite[i];
        }
    }
    
    System.out.println(ans);
  }
}

Compiler output:
Main.java:11: error: ']' expected
    int leftBlack[N];
                  ^
Main.java:11: error: ';' expected
    int leftBlack[N];
                   ^
Main.java:12: error: ']' expected
    int rightWhite[N];
                   ^
Main.java:12: error: ';' expected
    int rightWhite[N];
                    ^
4 errors
Language: C++

#include <stdio.h>
#include <iostream>
#include <limits.h>
#include <cstdlib>
#include <algorithm>
#include <unordered_map>
#include <vector>
using namespace std;

int main(void){
  int a;
  char n[200000] = "";
  int ans = 0;
  cin >> a >> n;
  for(int i = 0; i < a ; ++i){
    if(n[i] == '#' && n[i+1] == '.'){
      if(n[i+2] == "."){
        n[i] = ".";
      }else{
        n[i+1] = '#';
      }
      ans++;
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |       if(n[i+2] == "."){
      |          ~~~~~~~^~~~~~
a.cc:18:16: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   18 |         n[i] = ".";
      |                ^~~
      |                |
      |                const char*
Language: C++

#include <stdio.h>
#include <iostream>
#include <limits.h>
#include <cstdlib>
#include <algorithm>
#include <unordered_map>
#include <vector>
using namespace std;

int main(void){
  int a;
  char n[200000] = "";
  int ans = 0;
  cin >> a >> n;
  for(int i = 0; i < a ; ++i){
    if(n[i] == '#' && n[i+1] == '.'){
      if(n[i+2] == "."){
        n[i] = "."
      }else{
        n[i+1] = '#';
      }
      ans++;
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |       if(n[i+2] == "."){
      |          ~~~~~~~^~~~~~
a.cc:18:16: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   18 |         n[i] = "."
      |                ^~~
      |                |
      |                const char*
a.cc:18:19: error: expected ';' before '}' token
   18 |         n[i] = "."
      |                   ^
      |                   ;
   19 |       }else{
      |       ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    string s;
    cin >> n >> s;
    int firstblack = 0, lastwhite = n;
    for(int i = 0; i < n; i++) if(s[i] == '#') {
        firstblack = i;
        break;
    }
    for(int i = n - 1; i >= 0; i--) if(s[i] == '.') {
        lastwhite = i;
        break;
    }
    int lans = 0, rans = 0;
    for(int i = firstblack + 1; i < n; i++)
        lans += (s[i] == '.');
    for(int i = lastwhite - 1; i >= 0; i--)
        rans += (s[i] == '#')
    cout << min(lans, rans) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:30: error: expected ';' before 'cout'
   20 |         rans += (s[i] == '#')
      |                              ^
      |                              ;
   21 |     cout << min(lans, rans) << endl;
      |     ~~~~
Language: C++

n = int(input())
s = input()

w = s.count(".")
b = s.count("#")

c = 0

if w <= (n / 2):
    for i in range(1,n):
        if s[i - 1] + s[i] == "#.":
            c = s[i - 1:].count(".")
            break
else:
    for i in range(1,n):
        if s[i -1] + s[i] == "#.":
            c = s[i - 1:].count("#")
            break
print(c)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: Java

import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int N = scan.nextInt();
      	String s = scan.next();
      	int counterW = 0;
      	for(int i = 0; i < N; i++){
        	if(s.substring(i, i+1).contains(".")){
            	counterW++;
            }
        }
        int pointer = counterW;
      	int ans = counterW;
      	for(int i =0; i < N; i++){
        	if(s.substring(i, i+1).countains(".")){
            	pointer--;
            }
          	else{
            	pointer++;
            }
          	ans = Math.min(ans, pointer);
        }
      	System.out.print(ans);
    }
 
}

Compiler output:
Main.java:17: error: cannot find symbol
        	if(s.substring(i, i+1).countains(".")){
        	                      ^
  symbol:   method countains(String)
  location: class String
1 error
Language: Java

import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int N = scan.nextInt();
      	String s = scan.next();
      	int counterW = 0;
      	for(int i = 0; i < N; i++){
        	if(s.substring(i, i+1).contains(".") && counterB >0){
            	counterW++;
            }
        }
        int pointer = counterW;
      	int ans = counterW;
      	for(int i =0; i < N; i++){
        	if(s.substring(i, i+1).countains(".")){
            	pointer--;
            }
          	else{
            	pointer++;
            }
          	ans = Math.min(ans, pointer);
        }
      	System.out.print(ans);
    }
 
}
import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int N = scan.nextInt();
      	String s = scan.next();
      	int counterW = 0;
      	for(int i = 0; i < N; i++){
        	if(s.substring(i, i+1).contains(".") && counterB >0){
            	counterW++;
            }
        }
        int pointer = counterW;
      	int ans = counterW;
      	for(int i =0; i < N; i++){
        	if(s.substring(i, i+1).contains(".")){
            	pointer--;
            }
          	else{
            	pointer++;
            }
          	ans = Math.min(ans, pointer);
        }
      	System.out.print(ans);
    }
 
}


Compiler output:
Main.java:29: error: class, interface, enum, or record expected
import java.util.*;
^
1 error
Language: Java

import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int N = scan.nextInt();
      	String s = scan.next();
      	int counterW = 0;
      	for(int i = 0; i < N; i++){
        	if(s.substring(i, i+1).contains(".") && counterB >0){
            	counterW++;
            }
        }
        int pointer = counterW;
      	int ans = counterW;
      	for(int i =0; i < N; i++){
        	if(s.substring(i, i+1).countains(".")){
            	pointer--;
            }
          	else{
            	pointer++;
            }
          	ans = Math.min(ans, pointer);
        }
      	System.out.print(ans);
    }
 
}

Compiler output:
Main.java:10: error: cannot find symbol
        	if(s.substring(i, i+1).contains(".") && counterB >0){
        	                                        ^
  symbol:   variable counterB
  location: class Main
Main.java:17: error: cannot find symbol
        	if(s.substring(i, i+1).countains(".")){
        	                      ^
  symbol:   method countains(String)
  location: class String
2 errors
Language: Java

import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(Sysmtem.in);
      	int N = scan.nextInt();
      	String s = scan.next();
      	int counterW = 0;
      	int counterB = 0;
      	for(int i = 0; i < N; i++){
        	if(s.substring(i, i+1).contains(".")){
            	counterW++;
            }
          	else{
            	counterB++;
            }
        }
      	if(counterW < counterB){
        	System.out.print(counterW);
        }
      	else{
        	System.out.print(counterB);
        }
    
    }
 
}

Compiler output:
Main.java:5: error: cannot find symbol
    	Scanner scan = new Scanner(Sysmtem.in);
    	                           ^
  symbol:   variable Sysmtem
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(Sysmtem.in);
      	int N = scan.nextInt():
      	String s = scan.next();
      	int counterW = 0;
      	int counterB = 0;
      	for(int i = 0; i < N; i++){
        	if(s.substring(i, i+1).contains(".")){
            	counterW++;
            }
          	else{
            	counterB++;
            }
        }
      	if(counterW < counterB){
        	System.out.print(counterW);
        }
      	else{
        	System.out.print(counterB);
        }
    
    }

}

Compiler output:
Main.java:6: error: ';' expected
      	int N = scan.nextInt():
      	                      ^
1 error
Language: Java

import java.util.Scanner;


public class Main2 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n, i;
		int count = 0;
		String s;
		n = sc.nextInt();
		s = sc.next();
		char[] sArray = s.toCharArray();

		for(i = 0; i < n - 1; i++) {
			if(sArray[i] == '#') {
				if(sArray[i + 1] == '.') {
				    count++;
				    sArray[i + 1] = '#';
				}
			}
		}
		System.out.println(count);
		sc.close();
	}
}

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

#include <algorithm>
#include <bitset>
// #include <boost/dynamic_bitset.hpp>
#include <cfloat>
#include <cmath>
#include <ctime>
#include <chrono>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <typeindex>
#include <typeinfo>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define DEBUG(x) cout << #x << ": " << x << endl
#define INFILE() freopen("input.txt", "r", stdin)
#define REP(i, a, b) for (int i = (a); i < (b); i++)
#define REPC(i, a) REP(i, 0, a)
#define RREP(i, a, b) for (int i = (a); i >= (b); i--)
#define RREPC(i, a) RREP(i, a, 0)
#define ALL(s) begin(s), end(s)
#define RALL(s) rbegin(s), rend(s)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using ll_i = pair<ll, int>;
using i_ll = pair<int, ll>;
using d_i = pair<double, int>;
using ll_ll = pair<ll, ll>;
using d_d = pair<double, double>;

static constexpr ll LL_MOD = 1000000009;
static constexpr ll LL2_MOD = 1000000007;
static constexpr double EPS = numeric_limits<double>::epsilon();
static constexpr double PI = 3.14159265358979323846264338327950288;

static map<type_index, const char *const> scanType = { { typeid(int), "%d" },
{ typeid(ll), "%lld" },
{ typeid(double), "%lf" },
{ typeid(char), "%c" } };

template <class T> static void scan(vector<T> &v);
static void scan(vector<string> &v, bool isWord = true);
// static boost::dynamic_bitset<> scan(char trueValue = 'o');

int main(int argc, char *argv[]) {
	 //INFILE();

	 ll l;
	 cin >> l;
	 string s;
	 cin >> s;
	 vector<ll> v(l);

	 ll count = 0;
	 for (int i = 0; i < l; i++) {
		 v[i] = count;
		 
		 if (s[i] == '#') count++;
	 }

	 if (count == 0) {
		 cout << 0 << endl;
		 return 0;
	}

	 count = 0;
	 ll minCount = 999999999;
	 for (int i = l - 1; i >= 0; i--) {
		 if (s[i] == '.') count++;

		 v[i] += count;
		 if (v[i] < minCount) minCount = v[i];
	 }

	 if (count == 0) {
		 cout << 0 << endl;
		 return;
	}

	 cout << minCount << endl;
	return 0;
}

template <class T> static void scan(vector<T> &v) {
	auto tFormat = scanType[typeid(T)];
	for (T &n : v) {
		scanf(tFormat, &n);
	}
}

static void scan(vector<string> &v, bool isWord) {
	if (isWord) {
		for (auto &n : v) {
			cin >> n;
		}
		return;
	}

	int i = 0, size = static_cast<int>(v.size());
	string s;
	getline(cin, s);

	if (s.size() != 0) {
		i++;
		v[0] = s;
	}

	for (; i < size; ++i) {
		getline(cin, v[i]);
	}
}

//static boost::dynamic_bitset<> scan(char trueValue) {
//	string s;
//	getline(cin, s);
//
//	if (s.size() == 0) {
//		getline(cin, s);
//	}
//
//	for_each(begin(s), end(s),
//		[trueValue](char &c) { c = (c == trueValue) ? '1' : '0'; });
//	return boost::dynamic_bitset<>(string(rbegin(s), rend(s)));
//}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:93:18: error: return-statement with no value, in function returning 'int' [-fpermissive]
   93 |                  return;
      |                  ^~~~~~
Language: C++


#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstddef>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

// clang-format off
template <typename T> T gcd(T a, T b) { return b == 0 ? a : gcd(b, a % b); }
template <typename T> T lcm(T a, T b) { return a * b / gcd(a, b); }
template <typename T> T clamp(T val, T min, T max) { return val < min ? min : (max < val ? max : val); }
template <typename T> size_t max_index(T begin, T end) { return distance(begin, max_element(begin, end)); }
template <typename T> size_t min_index(T begin, T end) { return distance(begin, min_element(begin, end)); }
// clang-format on

#define int long long
#define YES "Yes"
#define NO  "No"

using namespace std;

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

  int num;

  int n; cin >> n;
  string s; cin >> s;

  vector<int> mem(n);

  int white = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] != '#') ++white;
    mem[i] = white;
  }

  int tmp = mem[n - 1];
  num = min(tmp, n - tmp);

  for (int i = 1; i < n; ++i) {
    num = min(num, i + tmp - 2 * mem[i - 1];);
  }
  
  cout << num << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:44: error: expected ')' before ';' token
   60 |     num = min(num, i + tmp - 2 * mem[i - 1];);
      |              ~                             ^
      |                                            )
a.cc:60:45: error: expected primary-expression before ')' token
   60 |     num = min(num, i + tmp - 2 * mem[i - 1];);
      |                                             ^
Language: C++

#include <iostream>
#include <stirng>

using namespace std;

int main(){
  int n;
  string s;
  cin >> n >> s;
  int wcnt=0;
  for(int i=0;i<n;++i){
    if(s[i]=='.') wcnt++;
  }
  int min=n,lb=0,rw=wcnt;
  for(int i=0;i<n;++i){
    if(min>lb+rw) min = lb+rw;
    if(s[i]=='#') lb++;
    else if(s[i]=='.') rw--;
  }
  if(min>lb+rw) min = lb+rw;
  cout << min << endl;
  
  return 0;
}


Compiler output:
a.cc:2:10: fatal error: stirng: No such file or directory
    2 | #include <stirng>
      |          ^~~~~~~~
compilation terminated.
Language: C++

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

using namespace std;

int main(int argc, char const *argv[]) {
  int N;
  string S;
  cin >> N >> S;
  int white_array[N];
  int black_array[N];
  int white_count=0,black_count=0;
  for (int i = 0; i < N; i++) {
    if(S[i]=='.'){
      white_count++;
      if(i==0){
        white_array[0]=1;
        black_array[0]=0;
      }else{
        white_array[i]=white_array[i-1]+1;
        black_array[i]=black_array[i-1];
      }
    }
    else {
      black_count++;
      if(i==0){
        black_array[0]=1;
        white_array[0]=0;
      }else{
        white_array[i]=white_array[i-1];
        black_array[i]=black_array[i-1]+1;
      }
    }
  }

  int reverse_count = INT_MAX;
  for (int i = 0; i < N+1; i++) {
    if(i==0){
      reverse_count = min(reverse_count,white_count);
    }else if(i==N){
      reverse_count = min(reverse_count,black_count);
    }else{
      reverse_count = min(reverse_count,black_array[i-1]+white_count-white_array[i-1]);
    }
  }
  cout << reverse_count <<endl;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:37:23: error: 'INT_MAX' was not declared in this scope
   37 |   int reverse_count = INT_MAX;
      |                       ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include<algorithm>
  +++ |+#include <climits>
    4 |
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		String s = sc.next();
		String[] line = s.split("");
        List<Integer> array = new ArrayList<Integer>();
        int count = 0;
		//int sum = 0;
		int min = num;
for(int i=0; i<num; i++){
  if(line[i].equals(".")) count++;
}
int sum = count;
for(int i=0; i<naum; i++){
  if(line[i].eqacuals("#")) sum++;
  else sum--;
  //System.out.println(sum);
  if(sum < min) min = sum;
}
System.out.println(min);
    }
}

Compiler output:
Main.java:16: error: cannot find symbol
for(int i=0; i<naum; i++){
               ^
  symbol:   variable naum
  location: class Main
Main.java:17: error: cannot find symbol
  if(line[i].eqacuals("#")) sum++;
            ^
  symbol:   method eqacuals(String)
  location: class String
2 errors
Language: C++

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

int main() {
  int n;
    cin>>n;
  string s;
    cin>>s;
  
  vector<int>vec(n);
  vector<int>bec(n);
  
  if(s.at(0)=='#'){
    vec[0]=1;
  }
  else{
    vec[0]=-1;
    bec[0]=1;
  }
  for(int i=1;i<n;i++){
    if(s.at(i)=='#'){
      vec[i]+=1+vec[i-1];
      bec[i]=bec[i-1];
    }
    else{
      vec[i]+=vec[i-1]-1;
      bec[i]+=1+bec[i-1];
    }
  }
   sort(vec.begin(),vec.end());
   cout<<min({(vec[0]+bec[n-1]),bec[n-1],vec[0]})<<endl;
}
}

Compiler output:
a.cc:33:1: error: expected declaration before '}' token
   33 | }
      | ^
Language: C++

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
	String s = sc.next();
	int ans =Integer.MAX_VALUE;
	for(int i =0; i<n; i++) {
	 int c=0; 
	 for(int j=0;j<n;j++) {
	 if(s.charAt(j)=='#'&&j<=i) {c++;}
	 if(s.charAt(j)=='.'&&j>i) {c++;}
	 }
	ans = Math.min(c,ans);
	}
	
  System.out.println(ans);
    }

}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main {
      | ^~~~~~
Language: C++

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

int main(){
	int N, B=0, W=0, B_sum=0;
	string S;
  
  cin >> N;
  cin >> S;
  
  for(int i = 0; i < N;　i++){
  	if(S[i] == '#')
      B++;
    else{
      W++;
      B_sum += B;
    B = 0;
    }
  }
  
  if(B>W)
    cout << W << endl;
  else
    cout << B << endl;
  
	return 0;
}

Compiler output:
a.cc:12:24: error: extended character 　 is not valid in an identifier
   12 |   for(int i = 0; i < N;　i++){
      |                        ^
a.cc: In function 'int main()':
a.cc:12:24: error: '\U00003000i' was not declared in this scope
   12 |   for(int i = 0; i < N;　i++){
      |                        ^~~