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

import java.util.Scanner;

public class Main {

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

		int number=sc.nextInt();

		String str = new String();

			str=sc.next();


		int count=0;
		int sum=0;
		int count2=0;


		//
			for(int z=0;z<number;z++) {

				count=0;
				count2=0;


					while(str.charAt(z)=='#') {
						count++;
						z++;
						if(z>=number) break;}

						if(z>=number) break;
					while(str.charAt(z)=='.' && count2<count) {
						count2++;
						sum++;
						z++;
						if(z>=number) break;
					}
					if(z<number) z--;

					//z--;



	}
sc.close();
		System.out.print(sum);}


Compiler output:
Main.java:47: error: reached end of file while parsing
		System.out.print(sum);}
		                       ^
1 error
Language: Java

import java.util.Scanner;

public class AtCoder3 {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);

		int inputNum = sc.nextInt();
		sc.nextLine();


		String inputStr = sc.next();

		int cnt1 = 0;
		int cnt2 = 0;

		for(int i = 0 ; i < inputStr.length() ; i++) {

			if(inputStr.charAt(i) == '.') {

				cnt1 += 1;

			}else if(inputStr.charAt(i) == '#') {

				cnt2 += 1;

			}

		}

		if(cnt1 < cnt2) {


			if(inputStr.charAt(0) == '.') {
				System.out.println(cnt1-1);
			}else {
				System.out.println(cnt1);
			}




		}else if(cnt1 > cnt2) {

			if(inputStr.charAt(inputStr.length()-1) == '#') {
				System.out.println(cnt2-1);
			}else {
				System.out.println(cnt2);
			}


		}else if(cnt1 == cnt2) {

			if(inputStr.charAt(inputStr.length()-1) == '#' || inputStr.charAt(0) == '.') {
				System.out.println(cnt2-1);
			}else {
				System.out.println(cnt2);
			}

		}

	}

}

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

#include <bits/stdc++.h>
using namespace std;
long n, lengthcham, lengththang;
string s;
int main () {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> n >> s;
    for (int i = 0; i < n; i++) 
        if (s[i] == '.')    lengthcham++;
        else if (s[i] == '#')  lengththang++;
    }
    cout << min(lengthcham, lengththang) << endl;
    return 0;
}

Compiler output:
a.cc:12:5: error: 'cout' does not name a type
   12 |     cout << min(lengthcham, lengththang) << endl;
      |     ^~~~
a.cc:13:5: error: expected unqualified-id before 'return'
   13 |     return 0;
      |     ^~~~~~
a.cc:14:1: error: expected declaration before '}' token
   14 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){

	int N;

	cin>>N;
if(N==1)｛cout<<"0";return 0;｝
	string s;

	cin>>s;

	vector<int> v(N);

	v[0]=s[0]=='.'? 1:0;

	for(int i=1;i<N;i++)

	    v[i]=s[i]=='.'? v[i-1]+1:v[i-1];

	int ans=N;

	for(int i=0;i<N;i++)

	    ans=min(ans,i+1-v[i]+(v[N-1]-v[i]));

	cout<<ans<<endl;

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: '\U0000ff5bcout' was not declared in this scope
    8 | if(N==1)｛cout<<"0";return 0;｝
      |         ^~~~~~
a.cc:8:30: error: '\U0000ff5d' was not declared in this scope
    8 | if(N==1)｛cout<<"0";return 0;｝
      |                              ^~
a.cc:11:14: error: 's' was not declared in this scope
   11 |         cin>>s;
      |              ^
Language: C++

#include<iostream>
#include<algriothm>
#include<vector>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<int> v(N);
  string s;
  cin>>s;
  v[0]=s[0]=='.'? 1:0;
  for(int i=1;i<N;i++)
    v[i]=s[i]=='.'? v[i-1]+1:v[i-1];
  int ans=N;
  for(int i=0;i<N;i++)
    ans=min(ans,i+1-v[i]+N-i-1-(v[N-1]-v[i]));
  return ans;
}

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

#include <iostream>                    
#include <string>                      
using namespace std;                   
                                       
void rev(string s,int now,int* count){ 
  if(now == 0 || s[now-1] == '.') retur
  if(now -1 >= 0 && s[now-1] == '#'){  
    s[now-1] = '.';                    
    (*count)++;                        
    rev(s,now-1,count);                
  }                                    
}                                      
int main(void){                        
  int N,n,count = 0;                   
  int wcount = 0,bcount = 0;           
  int w = 0,b = 0;                     
  string s;                            
  cin >> N;                            
  cin >> s;                            
  n = s.size();                        
  for(int i = 0; i < n;++i){           
    //黒                                
    if(s[i] == '#'){                   
      bcount++;                        
      if(i <n-1 && s[i+1] == '.'){     
        if(bcount > wcount){           
          s[i+1] = '#';                
        }                              
        else if(bcount <= wcount){     
          s[i] = '.';                  
          rev(s,i,&count);             
        }                              
        count++;                       
      }                                
    }                                  
    //白                                
    else if(s[i] == '.'){              
      wcount++;                        
    }                                  
  }                                    
  cout << count << endl;               
  return 0;                            
}

Compiler output:
a.cc: In function 'void rev(std::string, int, int*)':
a.cc:6:35: error: 'retur' was not declared in this scope
    6 |   if(now == 0 || s[now-1] == '.') retur
      |                                   ^~~~~
Language: C++

#include <iostream>                    
#include <string>                      
using namespace std;                   
                                       
int main(void){                        
  int N,n,count = 0;                   
  int wcount = 0,bcount = 0;           
  int w = 0,b = 0;                     
  string s;                            
  cin >> N;                            
  cin >> s;                            
  n = s.size();                        
  for(int i = 0; i < n;++i){           
    //黒                                
    if(s[i] == '#'){                   
      bcount++;                        
      if(i <n-1 && s[i+1] == '.'){     
        if(bcount > wcount){           
          s[i+1] = '#';                
        }                              
        else if(bcount <= wcount){     
          s[i] = '.';                  
          rev(s,i,&count);             
        }                              
        count++;                       
      }                                
    }                                  
    //白                                
    else if(s[i] == '.'){              
      wcount++;                        
    }                                  
  }                                    
  cout << count << endl;               
  return 0;                            
}                                      
                                       
                                       

Compiler output:
a.cc: In function 'int main()':
a.cc:23:11: error: 'rev' was not declared in this scope
   23 |           rev(s,i,&count);
      |           ^~~
Language: C

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{
  int n,count = 0, ans = 0;
  char *s;
  scanf("%d",&n);
  s = new char[n+1];
  scanf("%s",s);

  for (int i = 0; i < n ; ++i)
    if (s[i] == '.')
      ++count;
  
  ans = count;
  for (int i = 0 ; i < n ; ++i) {
    if(s[i]=='#') ++count;
    else --count;
    ans = min(ans,count);
  }
  
  printf("%d",ans);
  delete s;
  return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  string S;
  cin >> N >> S;
  int a, b;
  a = 0;
  b = 0;  
  for(int i=0;i<N;i++){
    if(S[i] == '#'){
      for(int j=i;j<N;j++){
        if(S[j] == '.') a++;
      }
    }
  }
  sort(S.begin(), S,end());
  for(int i=0;i<N;i++){
    if(S[i] == '.'){
      for(int j=i;j<N;j++){
        if(S[j] == '#') b++;
      }
    }
  }
  cout << min(a, b) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:24: error: no matching function for call to 'end()'
   17 |   sort(S.begin(), S,end());
      |                     ~~~^~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/string:53,
                 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/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1249:5: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
 1249 |     end(valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1249:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/valarray:1265:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1265:5: note:   candidate expects 1 argument, 0 provided
Language: C++

#include <iostream>
#include <string>
using namespace std;
int n, m,ans;
string s;
int l[500000];

void read() {
	cin >> n;
	getline(cin, s);
	getline(cin, s);
}
void prep() {
	l[0] = 0;
	for (int i = 1; i <= n; i++) {
		l[i] = l[i - 1] + (s[i] == '#');
	}
	ans = l[n];
	int sum = 0;
	for (int i = n-1; i >=0; i--) {
		sum += (s[i] == '.');
		if (sum + l[i] < ans)ans = sum + l[i];
	}
}
void run(){

}
void print() {
	cout << ans << ;
}
int main(){
	read();
	prep();
	run();
	print();
}

Compiler output:
a.cc: In function 'void print()':
a.cc:29:24: error: expected primary-expression before ';' token
   29 |         cout << ans << ;
      |                        ^
Language: C++

#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <chrono>
#include <vector>

using namespace std;

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

    int w_cnt = 0;
    int b_cnt = 0;

    for (int i = 0; i < N; i++)
    {
        if (s[i] == '.')
        {
            w_cnt += 1;
        }
    }
    int ans = w_cnt;

    for (int i = 0; i < N; i++)
    {
        if (s[i] == '#')
        {
            b_cnt += 1;
        }
        else
        {
            w_cnt -= 1;
        }
        ans = min(ans, w_cnt + b_cnt);
    }
    cout << ans << endl;
    return 0;
}


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


#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
/* #include <regex> */

using namespace std;

/* g++ -g -fsanitize=address -lasan -std=c++11 -Dfoo_ */

/* freopen("input.txt", "rt", stdin); */
/* freopen("output.txt", "wt", stdout); */

#define ALL(c)          (c).begin(), (c).end()
#define ALLR(c)         (c).rbegin(), (c).rend()
#define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
#define FORR(i,a,b)     for (int i=(a); i > (b); --i)
#define FOR_ALL(i,c)    for (__typeof((c).begin()) i=(c).begin();   \
                             i != (c).end(); ++i)
#define FOR_ALLR(i,c)   for (__typeof((c).rbegin()) i=(c).rbegin(); \
                             i != (c).rend(); ++i)
#define SZ(array)       (sizeof(array)/sizeof(array[0]))
#define lc(x)           (x<<1)     /* 2*x */
#define rc(x)           (x<<1 | 1) /* 2*x+1 */
#define lowbit(x)       (x & (-x)) /* 0b10100 -> 0b100 */

typedef long long       LL;
typedef map<int,int>    MII;
typedef pair<int,int>   PII;
typedef set<int>        SI;
typedef vector<bool>    VB;
typedef vector<double>  VD;
typedef vector<int>     VI;
typedef vector<string>  VS;

/* check if a key is in container C */
template <class C>
inline bool in_(const typename C::key_type& k, const C& A)
{ return A.find(k) != A.end(); }
inline bool in_(const string& s, const string& S)
{ return S.find(s) != string::npos; }

/* the recursive version can't go to 2e5 */

const int inf = 1e9;
int n; string s;

bool isW(const int i)
{ return s[i] == '.'; }
bool isB(const int i)
{ return !isW(i); }

int main()
{
#ifdef foo_
    freopen("foo", "rt", stdin);
#endif
    ios::sync_with_stdio(false);
    while (cin >> n >> s) {
        s = '.' + s; n++;
        VI sumB(n+1), sumW(n+1);
        FOR(i,1,n)
            sumB[i] += sumB[i-1] + isB(i);
        FORR(i,n-1,0)
            sumW[i] += sumW[i+1] + isW(i);
        int ans = inf
        FOR(i,0,n)
            ans = min(ans, sumB[i] + sumW[i+1]);
        cout << ans << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:25: error: expected ',' or ';' before 'for'
   36 | #define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
      |                         ^~~
a.cc:87:9: note: in expansion of macro 'FOR'
   87 |         FOR(i,0,n)
      |         ^~~
a.cc:87:13: error: 'i' was not declared in this scope
   87 |         FOR(i,0,n)
      |             ^
a.cc:36:41: note: in definition of macro 'FOR'
   36 | #define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
      |                                         ^
Language: C++

// C.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <cstdout>

using namespace std;

int main(int argc, char *argv[]) {
	int n;
	cin >> n;
	string s;
	cin >> s;
	int dp[2] = {};
	for (char c : s) {
		int a = dp[0], b = dp[1];
		if (c == '.') {
			dp[0] = a;
			dp[1] = b + 1;
		} else {
			dp[0] = a + 1;
			dp[1] = min(a, b);
		}
	}
	int ans = min(dp[0], dp[1]);
	cout << ans << endl;
	fprintf(stderr, "1\n");
	return 0;
}


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


import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String S = sc.next();
        int[][] dp = new int[S.length()][2];
        
        if (S.charAt(0)=='.') {
            dp[0][0] = 0;
            dp[0][1] = 1;
        } else if (S.charAt(0)=='#') {
            dp[0][0] = 1;
            dp[0][1] = 0;
        }
        for (int i=1;i<S.length();++i){
            if (S.charAt(i)=='.') {
                dp[i][0] = dp[i-1][0];
                dp[i][1] = Math.min(dp[i-1][0],dp[i-1][1])+1;
            } else if (S.charAt(i)=='#') {
                dp[i][0] = dp[i-1][0]+1;
                dp[i][1] = Math.min(dp[i-1][0],dp[i-1][1]);
            }
        }
        int ans = Math.min(dp[dp.length-1][0],dp[dp.length-1][1]);
        System.out.println(ans);
    }
    
}


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

N=gets.to_i
S=gets
w=0
c=S.count "."
p ((0...N).map{|i|i+1+c-2*(S[i]>"#"&&w+=1)}<<c).min

Compiler output:
a.cc:5:5: error: too many decimal points in number
    5 | p ((0...N).map{|i|i+1+c-2*(S[i]>"#"&&w+=1)}<<c).min
      |     ^~~~~
a.cc:1:1: error: 'N' does not name a type
    1 | N=gets.to_i
      | ^
a.cc:5:44: error: expected unqualified-id before '<<' token
    5 | p ((0...N).map{|i|i+1+c-2*(S[i]>"#"&&w+=1)}<<c).min
      |                                            ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ul;
typedef signed long long ll;
ul over = 1000000007;

mt19937 mt(time(nullptr));
// uniform_int_distribution< int > rand_int(0, 10) // rand[0, 10] inclusive

int main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed;
  ul n;
  string s;
  cin >> n >> s;
  ul ans = 0, ans2=0;
  for (int i=s.size()-2; i>=0; --i) {
    if (s[i]=='#' && s[i+1]=='.') {
      ans++;
      s[i]='.'
    }
  }
  for (int i=0; i<s.size()-1; ++i) {
    if (s[i]=='#' && s[i+1]=='.') {
      ans2++;
      s[i+1] = '#';
    }
  }
  cout << min(ans2, ans) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:15: error: expected ';' before '}' token
   22 |       s[i]='.'
      |               ^
      |               ;
   23 |     }
      |     ~
Language: C++

#include <iostream>
#include <algorithm>

#define ll long long

using namespace std;

int n=-1,m=-1;
int a[1000000]={0};

int main(){
 cin>>n;
 char s[300009]="";
 cin>>s;
 
int j=0,f=0;
int p=0.q=0;
for(int i=0;i<n;++i){
  if(s[i]=='#') {j=1; p=1}
  
  if(j){
      if(s[i]==s[i-1]){
        if(f%4==0||f%4==3){
            p++;
        }else{
            q++;
        }
        }else{
            f++;
        }
      }
  }

 }
 cout<<min(p,q)<<endl;
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: lvalue required as left operand of assignment
   17 | int p=0.q=0;
      |       ^~~
a.cc:19:26: error: expected ';' before '}' token
   19 |   if(s[i]=='#') {j=1; p=1}
      |                          ^
      |                          ;
a.cc:26:13: error: 'q' was not declared in this scope
   26 |             q++;
      |             ^
a.cc: At global scope:
a.cc:35:2: error: 'cout' does not name a type
   35 |  cout<<min(p,q)<<endl;
      |  ^~~~
a.cc:36:2: error: expected unqualified-id before 'return'
   36 |  return 0;
      |  ^~~~~~
a.cc:37:1: error: expected declaration before '}' token
   37 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>

#define ll long long

using namespace std;

int n=-1,m=-1;
int a[1000000]={0};

int main(){
 cin>>n;
 char s[300009]="";
 cin>>s;
 
int j=0,f=0;
int p=0.q=0;
for(int i=0;i<n;++i){
  if(s[i]=='#') {j=1; p=1}
  
  if(j){
      if(s[i]==s[i-1]){
        if(f%4==0||f%4==3){
            p++;
        }else{
            q++;
        }else{
            f++;
        }
      }
  }

 }
 cout<<min(p,q)<<endl;
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: lvalue required as left operand of assignment
   17 | int p=0.q=0;
      |       ^~~
a.cc:19:26: error: expected ';' before '}' token
   19 |   if(s[i]=='#') {j=1; p=1}
      |                          ^
      |                          ;
a.cc:26:13: error: 'q' was not declared in this scope
   26 |             q++;
      |             ^
a.cc:27:10: error: expected '}' before 'else'
   27 |         }else{
      |          ^~~~
a.cc:22:23: note: to match this '{'
   22 |       if(s[i]==s[i-1]){
      |                       ^
a.cc: At global scope:
a.cc:34:2: error: 'cout' does not name a type
   34 |  cout<<min(p,q)<<endl;
      |  ^~~~
a.cc:35:2: error: expected unqualified-id before 'return'
   35 |  return 0;
      |  ^~~~~~
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

#include <iostream>

int main() {
  int N;
  std::cin >> N;

  int whites = 0;
  int blacks = 0;

  int whites_of_left = 0;
  int whites_of_right = 0;

  for (int i=0; i<N; i++) {
    char c;
    std::cin >> c;

    if (c == '.') {
      whites++;
      if (blacks == 0) whites_of_left++;

      blacks += blacks_of_right;
      blacks_of_right = 0;
    } else {
      blacks_of_right++;
    }
  }

  int ans = std::min(whites-whites_of_left, blacks-blacks_of_right);

  std::cout << ans << '\n';

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'blacks_of_right' was not declared in this scope; did you mean 'whites_of_right'?
   21 |       blacks += blacks_of_right;
      |                 ^~~~~~~~~~~~~~~
      |                 whites_of_right
a.cc:24:7: error: 'blacks_of_right' was not declared in this scope; did you mean 'whites_of_right'?
   24 |       blacks_of_right++;
      |       ^~~~~~~~~~~~~~~
      |       whites_of_right
a.cc:28:52: error: 'blacks_of_right' was not declared in this scope; did you mean 'whites_of_right'?
   28 |   int ans = std::min(whites-whites_of_left, blacks-blacks_of_right);
      |                                                    ^~~~~~~~~~~~~~~
      |                                                    whites_of_right
Language: C++

#include <bits/stdc++.h>
using namespace std;
#ifdef ENABLE_DEBUG
#define dump(a) cerr<<#a<<"="<<a<<endl
#define dumparr(a,n) cerr<<#a<<"["<<n<<"]="<<a[n]<<endl
#else
#define dump(a) 
#define dumparr(a,n) 
#endif
#define FOR(i, a, b) for(int i = a;i < b;i++)
#define For(i, a) FOR(i, 0, a)
#define REV(i, a, b) for(int i = b-1;i >= a;i--)
#define Rev(i, a) REV(i, 0, a)
#define REP(a) For(i, a)

typedef long long int ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
typedef pair<ll,pll> ppll;
typedef vector<ll> vll;

const ll INF=(1LL<<50);

deque<ll> stones;
void solve(long long N, std::string S){
    char prev='b';
    int n=0;
    for (auto &&i : v)
    {
        if(i==prev){
            n++;
        }else{
            prev=i;
            stones.push_back(n);
        }
    }
    if(S[0]=='.')stones.pop_front();
    if(S.back()=='#')stones.pop_back();
    ll l=0,r=0;
    for(long long i = 1; i < stones.size(); i+=2){
        r+=stones[i];
    }
    ll ans=l+r;
    for(long long i = 0; i < stones.size(); i+=2){
        l+=stones[i];
        r-=stones[i+1];
        ans=min(ans,l+r);
    }
    cout<<ans<<endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::string S;
    std::cin >> S;
    solve(N, S);
    return 0;
}


Compiler output:
a.cc: In function 'void solve(long long int, std::string)':
a.cc:29:21: error: 'v' was not declared in this scope
   29 |     for (auto &&i : v)
      |                     ^
Language: C

#include <stdio.h>

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

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

		if(s[i-1]=='.'&&s[i]=='#'&&s[i+1]=='#'){
			bcount++;
		}
		if(s[i-1]=='#'&&s[i]=='#'&&s[i+1]=='#'){
			bcount++;
		}
		if(s[i-1]=='#'&&s[i]=='#'&&s[i+1]=='.'){
			bcount=0;
		}
	}

	if(bcount>=wcount) print("%d",ans+wcount);
	else printf("%d",ans+bcount);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:41:28: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   41 |         if(bcount>=wcount) print("%d",ans+wcount);
      |                            ^~~~~
      |                            printf
Language: Java

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

import util.Utils;

public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            String S = in.next();
            char[] cs = S.toCharArray();

            ArrayList<Integer> l = new ArrayList<>();
            char prev = cs[0];
            int count = 1;
            for (int i = 1; i <= cs.length; i++) {
                if (i == cs.length || cs[i] != prev) {
                    l.add(prev == '.' ? count : -count);
                    count = 0;
                    if (i == cs.length) {
                        continue;
                    }
                }
                count++;
                prev = cs[i];
            }

            if (l.size() > 0 && l.get(0).intValue() > 0) {
                l.remove(0);
            }
            if (l.size() > 0 && l.get(l.size() - 1).intValue() < 0) {
                l.remove(l.size() - 1);
            }

            l.add(0, 0);
            l.add(0);

//            Utils.debug(l);

            int[] cumsumW = new int[l.size()];
            int[] cumsumB = new int[l.size()];
            for (int i = 0; i < l.size(); i++) {
                int n = l.get(i).intValue();
                cumsumW[i] = (n <= 0 ? -n : 0) + (i - 1 >= 0 ? cumsumW[i - 1] : 0);
            }
            for (int i = l.size() - 1; i >= 0; i--) {
                int n = l.get(i).intValue();
                cumsumB[i] = (n >= 0 ? n : 0) + (i + 1 < l.size() ? cumsumB[i + 1] : 0);
            }

            int res = (int) 1e9;
            for (int i = 0; i + 1 < l.size(); i++) {
                res = Math.min(res, cumsumW[i] + cumsumB[i + 1]);
//                Utils.debug(i, cumsumW[i], cumsumB[i + 1], cumsumW[i] + cumsumB[i + 1]);
            }

            System.out.println(res);
        }
    }
}


Compiler output:
Main.java:4: error: package util does not exist
import util.Utils;
           ^
1 error
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
  int n;
  string str;
  cin>>n;
  cin>>str;

  int black_diff[200005]={0};
  int white_diff[200005]={0};
  vector<int>turning;

  for(int i=0;i<n;i++){
    if(i!=0){
      white_diff[i]=white_diff[i-1];
    }
    if(str[i]!='.'){
      white_diff[i]++;
    }
  for(int i=n-1;i>=0;i--){
    if(i!=n-1){
      black_diff[i]=black_diff[i+1];
    }
    if(str[i]!='#'){
      black_diff[i]++;
    }
  }

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

  int cnt=200009;
  for(int i=0;i<(int)turning.size();i++){
    int p=turning[i];
    cnt=min(cnt,white_diff[p]+black_diff[p+1]);
  }

  if(cnt==200009){
    cnt=0;
  }

  cout<<cnt<<endl;
  return(0);
}

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

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
  int n;
  string str;
  cin>>n;
  cin>>str;

  int black_diff[200005]={0};
  int white_diff[200005]={0};
  vector<int>turning;

  for(int i=0;i<n;i++){
    if(i!=0){
      white_diff[i]=white_diff[i-1];
    }
    if(str[i]!='.'){
      white_diff[i]++;
    }
  for(int i=n-1;i>=0;i--){
    if(i!=n-1){
      black_diff[i]=black_diff[i+1];
    }
    if(str[i]!='#'){
      black_diff[i]++;
    }
  }

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

  int cnt=200009;
  for(int i=0;i<(int)turning.size();i++){
    int p=turning[i];
    cnt=min(cnt,white_diff[p]+black_diff[p+1]);
  }

  if(cnt==200009){
    cnt=0;
  }

  cout<<cnt<<endl;
  return(0);
}



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

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
using namespace std;
int main(){
  int n;
  string str;
  cin>>n;
  cin>>str;
 
  int black_diff[200005]={0};
  int white_diff[200005]={0};
  vector<int>turning;
 
  for(int i=0;i<n;i++){
    if(i!=0){
      white_diff[i]=white_diff[i-1];
    }
    if(str[i]!='.'){
      white_diff[i]++;
    }
    for(int i=n-1;i>=0;i--){
    if(i!=n-1){
      black_diff[i]=black_diff[i+1];
    }
    if(str[i]!='#'){
      black_diff[i]++;
    }
  }
 
  for(int i=0;i<n-1;i++){
    if(str[i]=='.'&&str[i+1]=='#'){
      turning.push_back(i);
    }
  }
 
  int cnt=200009;
  for(int i=0;i<(int)turning.size();i++){
    int p=turning[i];
    cnt=min(cnt,white_diff[p]+black_diff[p+1]);
  }
 
  if(cnt==200009){
    cnt=0;
  }
 
  cout<<cnt<<endl;
  return(0);
}
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
  int n;
  string str;
  cin>>n;
  cin>>str;

  int black_diff[200005]={0};
  int white_diff[200005]={0};
  vector<int>turning;

  for(int i=0;i<n;i++){
    if(i!=0){
      white_diff[i]=white_diff[i-1];
    }
    if(str[i]!='.'){
      white_diff[i]++;
    }
    for(int i=n-1;i>=0;i--){
    if(i!=n-1){
      black_diff[i]=black_diff[i+1];
    }
    if(str[i]!='#'){
      black_diff[i]++;
    }
  }

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

  int cnt=INT_MAX;
  for(int i=0;i<(int)turning.size();i++){
    int p=turning[i];
    cnt=min(cnt,white_diff[p]+black_diff[p+1]);
  }

  if(cnt==INT_MAX){
    cnt=0;
  }

  cout<<cnt<<endl;
  return(0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   60 | int main(){
      |         ^~
a.cc:60:9: note: remove parentheses to default-initialize a variable
   60 | int main(){
      |         ^~
      |         --
a.cc:60:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:60:11: error: a function-definition is not allowed here before '{' token
   60 | int main(){
      |           ^
a.cc:104:2: error: expected '}' at end of input
  104 | }
      |  ^
a.cc:10:11: note: to match this '{'
   10 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
using namespace std;
int main(){
  int n;
  string str;
  cin>>n;
  cin>>str;
 
  int black_diff[200005]={0};
  int white_diff[200005]={0};
  vector<int>turning;
 
  for(int i=0;i<n;i++){
    if(i!=0){
      white_diff[i]=white_diff[i-1];
    }
    if(str[i]!='.'){
      white_diff[i]++;
    }
    for(int i=n-1;i>=0;i--){
    if(i!=n-1){
      black_diff[i]=black_diff[i+1];
    }
    if(str[i]!='#'){
      black_diff[i]++;
    }
  }
 
  for(int i=0;i<n-1;i++){
    if(str[i]=='.'&&str[i+1]=='#'){
      turning.push_back(i);
    }
  }
 
  int cnt=INT_MAX;
  for(int i=0;i<(int)turning.size();i++){
    int p=turning[i];
    cnt=min(cnt,white_diff[p]+black_diff[p+1]);
  }
 
  if(cnt==INT_MAX){
    cnt=0;
  }
 
  cout<<cnt<<endl;
  return(0);
}
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
  int n;
  string str;
  cin>>n;
  cin>>str;

  int black_diff[200005]={0};
  int white_diff[200005]={0};
  vector<int>turning;

  for(int i=0;i<n;i++){
    if(i!=0){
      white_diff[i]=white_diff[i-1];
    }
    if(str[i]!='.'){
      white_diff[i]++;
    }
    for(int i=n-1;i>=0;i--){
    if(i!=n-1){
      black_diff[i]=black_diff[i+1];
    }
    if(str[i]!='#'){
      black_diff[i]++;
    }
  }

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

  int cnt=INT_MAX;
  for(int i=0;i<(int)turning.size();i++){
    int p=turning[i];
    cnt=min(cnt,white_diff[p]+black_diff[p+1]);
  }

  if(cnt==INT_MAX){
    cnt=0;
  }

  cout<<cnt<<endl;
  return(0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   60 | int main(){
      |         ^~
a.cc:60:9: note: remove parentheses to default-initialize a variable
   60 | int main(){
      |         ^~
      |         --
a.cc:60:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:60:11: error: a function-definition is not allowed here before '{' token
   60 | int main(){
      |           ^
a.cc:104:2: error: expected '}' at end of input
  104 | }
      |  ^
a.cc:10:11: note: to match this '{'
   10 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <bitset>
#include <functional>
#include <set>
#include <map>
#include <array>

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define fst first
#define snd second
#define pb push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define debug(x) cout << #x << ": " << x << endl
const int MOD = 1000000007;
const int INF = 100100100;
const double EPS = 0.000000001;

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

bool pairCompare(const P& pair1, const P& pair2) {
    return pair1.second > pair2.second;
}


int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  string s;
  cin >> n;
  cin >> s;
  int ans = 0;
  int last = 0;
  REP(i, n-1){
    if(s[i] == '#' && s[i+1] == '.'){
      if(i == 0 || i+3 > n || (s[i-1] == '#' && s[i+2] == '.') ans += 2;
      else ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:63: error: expected ';' before 'ans'
   52 |       if(i == 0 || i+3 > n || (s[i-1] == '#' && s[i+2] == '.') ans += 2;
      |                                                               ^~~~
      |                                                               ;
a.cc:53:7: error: expected primary-expression before 'else'
   53 |       else ans++;
      |       ^~~~
a.cc:52:73: error: expected ')' before 'else'
   52 |       if(i == 0 || i+3 > n || (s[i-1] == '#' && s[i+2] == '.') ans += 2;
      |         ~                                                               ^
      |                                                                         )
   53 |       else ans++;
      |       ~~~~
Language: C++

#include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

#define SREP(s,i,m) for(unsigned int i = s; i < m; ++i)
#define REP(i,m) SREP(0,i,m)

using namespace std;
#ifdef _MSC_VER
using LONG = __int64;
using ULONG = unsigned __int64;
#else
using LONG = long long int;
using ULONG = unsigned long long int;
#endif

// 二乗を計算する。
int sq(int x) { return x * x; }

// 領域内にいるか。
bool within(int x, int min, int max) {
	return min <= x && x <= max;
}

// container の中から key より小さい値を見つける。
// 見つからない場合は container.end() を返す。
template<typename T>
typename T::iterator less_than(T& container, typename T::key_type& key) {
	typename T::iterator prev = container.lower_bound(key);
	if (prev == container.begin()) prev = container.end();
	else prev--;
	return prev;
}

// container の中から key より大きい値を見つける。
// 見つからない場合は container.end() を返す。
template<typename T>
typename T::iterator greater_than(T & container, typename T::key_type & key) {
	return container.upper_bound(key);
}

// b^e (mod m) を求める
LONG modpow(LONG b, LONG e, LONG m) {
	LONG result = 1;
	while (e > 0) {
		if ((e & 1) == 1) result = (result * b) % m;
		e >>= 1;
		b = (b * b) % m;
	}
	return result;
}

int B[300000] = { 0 };
int W[300000] = { 0 };
int main(void) {
	int N;
	string S;
	cin >> N >> S;
	int count = 0;
	for (int i = 0; i < N; ++i) {
		if (S[i] == '#') count++;
		W[i] = count;
	}
	count = 0;
	for (int i = N - 1; i >= 0; --i) {
		if (S[i] == '.') count++;
		B[i] = count;
	}

	int ans = INT_MAX;
	for (int i = 0; i < N; ++i) {
		ans = min(ans, W[i] + B[i + 1]);
	}

	cout << ans << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:78:19: error: 'INT_MAX' was not declared in this scope
   78 |         int ans = INT_MAX;
      |                   ^~~~~~~
a.cc:10:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    9 | #include <stack>
  +++ |+#include <climits>
   10 | #include <string>
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
  int n;
  string str;
  cin>>n;
  cin>>str;

  int black_diff[200005]={0};
  int white_diff[200005]={0};
  vector<int>turning;

  for(int i=0;i<n;i++){
    if(i!=0){
      white_diff[i]=white_diff[i-1];
    }
    if(str[i]!='.'){
      white_diff[i]++;
    }
    for(int i=n-1;i>=0;i--){
    if(i!=n-1){
      black_diff[i]=black_diff[i+1];
    }
    if(str[i]!='#'){
      black_diff[i]++;
    }
  }

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

  int cnt=INT_MAX;
  for(int i=0;i<(int)turning.size();i++){
    int p=turning[i];
    cnt=min(cnt,white_diff[p]+black_diff[p+1]);
  }

  if(cnt==INT_MAX){
    cnt=0;
  }

  cout<<cnt<<endl;
  return(0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:11: error: 'INT_MAX' was not declared in this scope
   38 |   int cnt=INT_MAX;
      |           ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include<vector>
  +++ |+#include <climits>
    5 | using namespace std;
a.cc:50:2: error: expected '}' at end of input
   50 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

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

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin(),(c).end()
#define dump(x) cout << #x << " = " << (x) << endl

template<class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
	os<<"("<<p.first<<","<<p.second<<")";
	return os;
}

template<class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
	os<<"{";
	rep(i, v.size()) {
		if (i) os<<",";
		os<<v[i];
	}
	os<<"}";
	return os;
}

using namespace std;

int main() {
long long N;
string S;
cin >> N;
cin >> S;
int count=0,count2=0;
for (int i = 0; i < N; ++i){
if(S[i]=="#") count++;
if(S[i]==".") count2++;
}
if(count > count2) cout << count2 << endl;
else cout << count << endl;

return 0;








}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   43 | if(S[i]=="#") count++;
a.cc:44:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   44 | if(S[i]==".") count2++;
Language: Java

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

public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            String S = in.next();
            char[] cs = S.toCharArray();

            ArrayList<Integer> l = new ArrayList<>();
            char prev = cs[0];
            int count = 1;
            for (int i = 1; i <= cs.length; i++) {
                if (i == cs.length || cs[i] != prev) {
                    l.add(prev == '.' ? count : -count);
                    count = 0;
                    if (i == cs.length) {
                        continue;
                    }
                }
                count++;
                prev = cs[i];
            }

            if (l.size() > 0 && l.get(0).intValue() > 0) {
            } else {
                l.add(0, 0);
            }
            if (l.size() > 0 && l.get(l.size() - 1).intValue() < 0) {
            } else {
                l.add(0);
            }

            int[] cumsumW = new int[l.size()];
            int[] cumsumB = new int[l.size()];
            for (int i = 0; i < l.size(); i++) {
                int n = l.get(i).intValue();
                cumsumW[i] = (n >= 0 ? n : 0) + (i - 1 >= 0 ? cumsumW[i - 1] : 0);
            }
            for (int i = l.size() - 1; i >= 0; i--) {
                int n = l.get(i).intValue();
                cumsumB[i] = (n <= 0 ? -n : 0) + (i + 1 < l.size() ? cumsumB[i + 1] : 0);
            }

            int res = (int) 1e9;
            for (int i = 0; i < l.size(); i++) {
                res = Math.min(res, cumsumW[i] + cumsumB[i]);
                Utils.debug(i, cumsumW[i], cumsumB[i], cumsumW[i] + cumsumB[i]);
            }

            System.out.println(res);
        }
    }
}


Compiler output:
Main.java:49: error: cannot find symbol
                Utils.debug(i, cumsumW[i], cumsumB[i], cumsumW[i] + cumsumB[i]);
                ^
  symbol:   variable Utils
  location: class Main
1 error
Language: C

#include <stdio.h>

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


Compiler output:
main.c: In function 'main':
main.c:16:36: error: expected ')' before '[' token
   16 |         if(s[0]=='.'&&s[1]=='#',&&s[2]=='#') ans--;
      |           ~                        ^
      |                                    )
main.c:16:9: error: label 's' used but not defined
   16 |         if(s[0]=='.'&&s[1]=='#',&&s[2]=='#') ans--;
      |         ^~
Language: C++


#include "Macro.h"

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

	llong start_black = 0;
	for (const auto& e : s)
	{
		if (e == '#')
			break;
		start_black++;
	}

	if (start_black == (llong)s.size() || (llong)s.size() == 1)
	{
		cout << 0;
		return 0;
	}

	llong rcount_black = 0;
	for (llong i = (llong)s.size() - 1; start_black < i; i--)
	{
		if (rcount_black == (llong)s.size() - (start_black + 1))
			break;
		if (s[i] == '.')
			break;
		rcount_black++;
	}

	llong count_black = 0;
	llong count_white = 0;
	for (llong i = start_black; i < (llong)s.size(); i++)
	{
		if (s[i] == '#')
			count_black++;
		else
			count_white++;
	}
	if (min(count_black, count_white) == count_black)
	{
		cout << count_black - rcount_black;
		return 0;
	}

	cout << count_white;
	return 0;
}

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

#include <string>
#include <iostream>
#include <vector>
#include <stack>
#include <stdio.h>
#include <math.h>
#include <utility>
#include <algorithm>

using namespace std;

long long main() {
	long long n;
	string s;
	cin >> n;
	cin >> s;
	long long cnt = 0;
	for (long long i = 0; i < n; i++) {
		if (s[i] == '#') {
			long long now = i;
			for (; i < n; i++) {
				if (s[i] == '.') {
					break;
				}
			}
			long long sw = i - now;
			now = i;
			for (; i < n; i++) {
				if (s[i] == '#') {
					break;
				}
			}
			long long dw = i - now;
			cnt += sw < dw ? sw : dw;
		}
		//
	}
	cout << cnt;
	return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

using namespace std;
using llong = long long;
using ullong = unsigned long long;

#ifndef __MACRO_H__
#define __MACRO_H__

#define all(collection)  (collection).begin(), (collection).end()
#define loop(i, times) for (llong i = 0; i < times; i++)
#define rloop(i, times) for (llong i = times -1; 0 <= i; i--)

std::chrono::system_clock::time_point  start;

void TimeStart(void)
{
	start = std::chrono::system_clock::now();
}

void TimeEnd(void)
{
	auto time = std::chrono::system_clock::now() - start;
	auto msec = std::chrono::duration_cast<std::chrono::milliseconds>(time).count();
	cerr << endl << msec << " msec " << endl;
}

#endif


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

	llong start_black = 0;
	for (const auto& e : s)
	{
		if (e == '#')
			break;
		start_black++;
	}

	if (start_black == (llong)s.size() || (llong)s.size() == 1)
	{
		cout << 0;
		return 0;
	}

	llong rcount_black = 0;
	for (llong i = (llong)s.size() - 1; start_black < i; i--)
	{
		if (rcount_black == (llong)s.size() - (start_black + 1))
			break;
		if (s[i] == '.')
			break;
		rcount_black++;
	}

	llong count_black = 0;
	llong count_white = 0;
	for (llong i = start_black; i < (llong)s.size(); i++)
	{
		if (s[i] == '#')
			count_black++;
		else
			count_white++;
	}
	if (min(count_black, count_white) == count_black)
	{
		cout << count_black - rcount_black;
		return;
	}

	cout << count_white;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:144:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
  144 |                 return;
      |                 ^~~~~~