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

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>

#define REP(i,n) for(i=0;i<n;i++)

int iin() {
    int i;
    scanf("%d", &i);
    return i;
}

long long llin() {
    long long i;
    scanf("%lld", &i);
    return i;
}

double din() {
    double i;
    scanf("%lf", &i);
    return i;
}

char cin() {
    char c;
    scanf("%c", &c);
    return c;
}

void stin(char *s) {
    scanf("%s", s);
}

void iout(int i) {
    printf("%d\n", i);
}

void llout(long long i) {
    printf("%lld\n", i);
}

void dout(double i) {
    printf("%lf\n", i);
}

void cout(char c) {
    printf("%c\n", c);
}

void stout(char *s) {
    printf("%s\n", s);
}

int dfs(int v, int n, int *visited, int table[n][n]) {
    int all_visited = 1, i;

    REP(i,n) {
        if (!visited[i]) {
            all_visited = 0;
            break;
        }
    }

    if (all_visited) {
        return 1;
    }

    int count = 0;

    REP(i,n) {
        if (!table[v][i]) continue;
        if (visited[i]) continue;

        visited[i] = 1;
        count += dfs(i, n, visited, table);
        visited[i] = 0;
    }

    return count;
}

int main() {
    int n = iin();
    char s[n];
    stin(s);
    int k = iin(), i;
    k--;
    REP(i,n) {
        if (s[k] != s[i]) s[i] = *;
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:92:35: error: expected expression before ';' token
   92 |         if (s[k] != s[i]) s[i] = *;
      |                                   ^
Language: C++

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

int main(){
    int n, i, k;
    cin >> n >> s >> k;
    for(i=0; i<n; i++){
        if(s[i] == s[k-1]){
            cout << s[i];
        }else{
            cout << '*';
        }
    }
    return 0;
}

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

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>

#define REP(i,n) for(i=0;i<n;i++)

int iin() {
    int i;
    scanf("%d", &i);
    return i;
}

long long llin() {
    long long i;
    scanf("%lld", &i);
    return i;
}

double din() {
    double i;
    scanf("%lf", &i);
    return i;
}

char cin() {
    char c;
    scanf("%c", &c);
    return c;
}

void stin(char *s) {
    scanf("%s", s);
}

void iout(int i) {
    printf("%d\n", i);
}

void llout(long long i) {
    printf("%lld\n", i);
}

void dout(double i) {
    printf("%lf\n", i);
}

void cout(char c) {
    printf("%c\n", c);
}

void stout(char *s) {
    printf("%s\n", s);
}

int dfs(int v, int n, int *visited, int table[n][n]) {
    int all_visited = 1, i;

    REP(i,n) {
        if (!visited[i]) {
            all_visited = 0;
            break;
        }
    }

    if (all_visited) {
        return 1;
    }

    int count = 0;

    REP(i,n) {
        if (!table[v][i]) continue;
        if (visited[i]) continue;

        visited[i] = 1;
        count += dfs(i, n, visited, table);
        visited[i] = 0;
    }

    return count;
}

int main() {
    int n = iin();
    char s[n];
    stin(s);
    int k = iin(), i;
    k--;
    REP(i,n) {
        if (s[k] != s[i]) s[i] = *
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:93:5: error: expected expression before '}' token
   93 |     }
      |     ^
Language: C++

#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define P pair<int, int>
#define PP pair<P,P>
#define T tuple<int,int,int> 
using namespace std;
 
int main(){
  int n; cin >> n;
  string s; cin >> s;
  int b=0;
  int sl=s.length();
  rep(i,sl){
    if(s[i]=='#') b++;
  }

  int ans=b;
  int w=0;
  b=0;

  rep(i,sl){
    if(s[i]=='#') w++;
    else if(w){
      b++;
    }
  }

  ans=min(ans,b);
  b=0;
  w=0;
  rep(i,sl){
    if(s[sl-i]=='.') w++;
    else if(w){
      b++;
    }
  }
  
  cout << min(ans,b) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'cin' was not declared in this scope
   10 |   int n; cin >> n;
      |          ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define MOD 1000000007
a.cc:11:3: error: 'string' was not declared in this scope
   11 |   string s; cin >> s;
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | #define MOD 1000000007
a.cc:11:20: error: 's' was not declared in this scope
   11 |   string s; cin >> s;
      |                    ^
a.cc:14:7: error: 'i' was not declared in this scope
   14 |   rep(i,sl){
      |       ^
a.cc:14:3: error: 'rep' was not declared in this scope
   14 |   rep(i,sl){
      |   ^~~
a.cc:29:7: error: 'min' was not declared in this scope; did you mean 'main'?
   29 |   ans=min(ans,b);
      |       ^~~
      |       main
a.cc:39:3: error: 'cout' was not declared in this scope
   39 |   cout << min(ans,b) << endl;
      |   ^~~~
a.cc:39:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:39:25: error: 'endl' was not declared in this scope
   39 |   cout << min(ans,b) << endl;
      |                         ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #define MOD 1000000007
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;cin>>N;
  string S;cin>>S;
  vector<int>A(N+1);
  vector<int>B(N+1);
  for(int i=0;i<N;i++){
    if(i!=0)A[i+1]+=A[i];
    if(S.at(i)=='#')A[i+1]++;
  }
  for(int i=N-1;i>=0;i--){
    if(i!=N-1)A[i]+=A[i+1];
    if(S.at(i)=='.')A[j]++;
  }
  int ans=10000000;
  for(int i=0;i<=N;i++){
    ans=min(ans,A[i]+A[j]);
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: 'j' was not declared in this scope
   14 |     if(S.at(i)=='.')A[j]++;
      |                       ^
a.cc:18:24: error: 'j' was not declared in this scope
   18 |     ans=min(ans,A[i]+A[j]);
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
  ll N,i,ans=;string S;cin>>N>>S;
  ll w[N+1];w[0]=0;ans=N;
  REP(i,N){
    w[i+1]=w[i];if(S[i]=='.')w[i+1]++;
  }
  REP(i,N+1)ans=min(ans,i-2*w[i]+w[N]);
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: expected primary-expression before ';' token
   11 |   ll N,i,ans=;string S;cin>>N>>S;
      |              ^
Language: Java

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 ans = 0;
      	int fast = -1;
      	int last = -1;
      	int ans 2 = 0;
      	for(int i=0;i<s.length();i++){
          if( s.charAt(i) == '#' ){
            fast = i;
            break;
          }
        }
      	for(int i=s.length()-1;i>-1;i--){
          if( s.charAt(i) == '.' ){
            last = i;
            break;
          }
        }
      	if( (fast != -1) && (last != -1) )
      	for(int i=fast;i<last+1;i++){
          if( s.charAt(i) == '.' ){
          	ans++;
          }
        }
      	if( ans > s.length() - last + 1 ){
          ans = s.length() - last + 1;
        }
      System.out.println(ans);
	}
}

Compiler output:
Main.java:10: error: ';' expected
      	int ans 2 = 0;
      	       ^
1 error
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define debug(var) do{cout << #var << " : "; view(var);}while(0)
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
template<class T> void view(T e) {cout << e << endl;}
template<class T> void view(const vector<T> &v) {for(const auto &e : v){cout << e << " ";} cout << endl;}
template<class T> void view(const vector<vector<T>> &vv) {for(const auto &v : vv){view(v);}}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;

int main() {
    int n; cin >> n;
    string s; cin >> s;
    s += '@';
    vint compress;
    int ct = 1;
    int ct_w = 0, ct_b = 0;
    rep(i,n) {
        if (s[i] == '.') ct_w++;
        if (s[i] == '#') ct_b++;
        if (s[i] != s[i+1]) {
            compress.push_back(ct);
            ct = 1;
        } else ct++;
    }
    int start = 1;
    if (s[0] == '.') start = 0;
    int ans = min(ct_w,ct_b);
    int n_com = compress.size();
    for (int i = start; i < n_com-1; i += 2) {
        int sum_l = 0, sum_r = 0;
        for (int j = i-1; j >= 0; j -= 2) ct_tmp += compress[j];
        for (int j = i+2; j < n_com; j += 2) ct_tmp += compress[j];
        ans = min(ans,ct_tmp);
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:43: error: 'ct_tmp' was not declared in this scope
   44 |         for (int j = i-1; j >= 0; j -= 2) ct_tmp += compress[j];
      |                                           ^~~~~~
a.cc:45:46: error: 'ct_tmp' was not declared in this scope
   45 |         for (int j = i+2; j < n_com; j += 2) ct_tmp += compress[j];
      |                                              ^~~~~~
a.cc:46:23: error: 'ct_tmp' was not declared in this scope
   46 |         ans = min(ans,ct_tmp);
      |                       ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define debug(var) do{cout << #var << " : "; view(var);}while(0)
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
template<class T> void view(T e) {cout << e << endl;}
template<class T> void view(const vector<T> &v) {for(const auto &e : v){cout << e << " ";} cout << endl;}
template<class T> void view(const vector<vector<T>> &vv) {for(const auto &v : vv){view(v);}}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;

int main() {
    int n; cin >> n;
    string s; cin >> s;
    int ans1 = 0;
    for (int i = 0; i < n-1; i++) {
        if (s[i] == '#' && s[i+1] == '.') {
            ans1++;
            s[i+1] = '#';
        }
    }
    int ans2 = 0;
    for (int i = n-2; i >= 0; i--) {
        if (s[i] == '#' && s[i+1] == '.') {
            ans2++;
            s[i] = '.'
        }
    }
    cout << min(ans1,ans2) << endl;
}

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

#include <bits/stdc++.h>

typedef long long ll;

#define rep(i, n) for (int i = 0; i < (ll)n; ++i)
#define repr(i, n) for (int i = n - 1; i >= 0; --i)
#define INF 10e7
#define MOD 1000000000 + 7
#define MAX 51000
#define all(x) (x).begin(), (x).end()
#define MX(x) *max_element(all(x))
#define MN(x) *min_element(all(x))
using namespace std;

void solve(void)
{
    int n;
    string s;
    cin >> n >> s;
    int cta = 0; //ctaは白の数
    rep(i, n) if (s[i] == '.') cta++;
    int c = 0;
    int b = 0;
    repr(i, n - 1)
    {
        if (s[i] == '#')
            b++;
        if (s[i] != s[i + 1])
        {
            int x = b;
            int y = n - (i + 1) - (c - b);
            ans = min(ans, x + y);
        }
    }
    cout << ans << endl;
}

int main(void)
{
    solve();
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:32:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   32 |             ans = min(ans, x + y);
      |             ^~~
      |             abs
a.cc:35:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   35 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n,i,w=0,b=0;
  cin>>n;
  string s;
  cin>>s;
  for(i=0;i<n;i++)
  {
    if(s[i]=='.')
    {
      w++;
    }
    else
    {
      b++;
    }
  }
    cout<<min(b,c)<<endl;
  return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'c' was not declared in this scope
   20 |     cout<<min(b,c)<<endl;
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
  ll N;
  cin>>N;
  string s;
  cin>>s;
  vector<ll>a(N,0);
  for(ll i=0;i<N-1;i++){
    if(s.at(i)=='#'&&s.at(i+1)=='.')a[i]=1;
  }
  vector<ll>S(N+1,0);
  for(ll i=0;i<N;i++)S[i+1]=S[i]+a[i];
cout<<S(N)<<endl;
}











Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: no match for call to '(std::vector<long long int>) (ll&)'
   15 | cout<<S(N)<<endl;
      |       ~^~~
Language: C++

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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define MOD 1000000007LL

#define rep(i, n) for(ll (i) = 0LL;(i) < (ll)(n);(i)++)
#define rep2(i, s, e) for(ll (i) = (ll)(s);(i) < (ll)(e);(i)++)
#define repi(i, n) for(ll (i) = 0LL;(i) <= (ll)(n);(i)++)
#define repi2(i, s, e) for(ll (i) = (ll)(s);(i) <= (ll)(e);(i)++)
#define per(i, n) for(ll (i) = (ll)(n) - 1LL;(i) >= 0LL;(i)--)
#define per2(i, s, e) for(ll (i) = (ll)(s) - 1LL;(i) >= (ll)(e);(i)--)
#define peri(i, n) for(ll (i) = (ll)(n);(i) >= 0LL;(i)--)
#define peri2(i, s, e) for(ll (i) = (ll)(s);(i) >= (ll)(e);(i)--)
#define iter(i, it) for(auto &(i): (it))

template<typename T, typename U> ostream& operator<<(ostream &s, const pair<T, U> m) {
    cout << "(" << m.first << ", " << m.second << ")";
    return s;
}
template<typename T, typename U> ostream& operator<<(ostream &s, const map<T, U> m) {
    ll c = 0;
    cout << "{ ";
    iter(i, m) cout << i << (c++ == m.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
    cout << "{ ";
    rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const list<T> &v) {
    ll c = 0;
    cout << "{ ";
    iter(i, v) cout << i << (c++ == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}

int main(void) {
    ll N;
    string S;
    cin >> N >> S;
    ll white = 0;
    ll ans = 0;
    iter(c, S) {
        if(c == '.') white++;
    }
    rep(i, N) {
        if(i < white && S[i] == '#') ans++;
        else if(i >= white && S[i] =='.') ans++;
    }
    cout << min(ans, white, N - white) << endl;
    return 0;
}


Compiler output:
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]':
a.cc:58:16:   required from here
   58 |     cout << min(ans, white, N - white) << endl;
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define MOD 1000000007LL

#define rep(i, n) for(ll (i) = 0LL;(i) < (ll)(n);(i)++)
#define rep2(i, s, e) for(ll (i) = (ll)(s);(i) < (ll)(e);(i)++)
#define repi(i, n) for(ll (i) = 0LL;(i) <= (ll)(n);(i)++)
#define repi2(i, s, e) for(ll (i) = (ll)(s);(i) <= (ll)(e);(i)++)
#define per(i, n) for(ll (i) = (ll)(n) - 1LL;(i) >= 0LL;(i)--)
#define per2(i, s, e) for(ll (i) = (ll)(s) - 1LL;(i) >= (ll)(e);(i)--)
#define peri(i, n) for(ll (i) = (ll)(n);(i) >= 0LL;(i)--)
#define peri2(i, s, e) for(ll (i) = (ll)(s);(i) >= (ll)(e);(i)--)
#define iter(i, it) for(auto &(i): (it))

template<typename T, typename U> ostream& operator<<(ostream &s, const pair<T, U> m) {
    cout << "(" << m.first << ", " << m.second << ")";
    return s;
}
template<typename T, typename U> ostream& operator<<(ostream &s, const map<T, U> m) {
    ll c = 0;
    cout << "{ ";
    iter(i, m) cout << i << (c++ == m.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
    cout << "{ ";
    rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const list<T> &v) {
    ll c = 0;
    cout << "{ ";
    iter(i, v) cout << i << (c++ == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}

int main(void) {
    ll N;
    string S;
    cin >> N >> S;
    ll white = 0;
    ll ans = 0;
    iter(c, S) {
        if(c == '.') white++;
    }
    rep(i, N) {
        if(i < white && S[i] == '#') ans++;
        else if(i >= white && s[i] =='.') ans++;
    }
    cout << min(ans, white, N - white) << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:56:31: error: 's' was not declared in this scope
   56 |         else if(i >= white && s[i] =='.') ans++;
      |                               ^
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]':
a.cc:58:16:   required from here
   58 |     cout << min(ans, white, N - white) << endl;
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include <functional>
#include<time.h>
#include <stack>
#include<iomanip>
#include<unordered_map>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define ll long long
#define llint long long int
#define sort(s) sort(s.begin(),s.end())
#define reverse(v)  reverse(v.begin(), v.end());
#define Yes(ans) if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define hei(a) vector<a>
#define whei(a) vector<vector<a>>
#define UF  UnionFind
#define rt (a); return (a); 
#define Pint pair<int,int>
#define Pll pair<ll,ll>
#define keta(a)  fixed << setprecision(a)
constexpr auto INF = 1000000000;
constexpr auto mod = 1000000007;
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0)return a;
	return gcd(b, a % b);
}

ll query(int a,int b,int k,int l,int r){
	aaa(k);
	if (l >= b || r <= a)return 0;
	if (a <=l  && b >= r) {
		return seg[k];
	}
	ll v1 = query(a, b, k*2+1, l, (l + r) / 2);
	ll v2 = query(a, b, k*2+2, (l + r) / 2, r);
	return v1 + v2;
}
struct UnionFind {
	vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

	UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
		for (int i = 0; i < N; i++) par[i] = i;
	}
	int size(int a) {
		return par[root(a)];
	}

	int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
		if (par[x] == x) return x;
		return par[x] = root(par[x]);
	}

	void unite(int x, int y) { // xとyの木を併合
		int rx = root(x); //xの根をrx
		int ry = root(y); //yの根をry
		if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
		par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
	}

	bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}
};

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

Compiler output:
a.cc: In function 'long long int query(int, int, int, int, int)':
a.cc:41:9: error: 'aaa' was not declared in this scope
   41 |         aaa(k);
      |         ^~~
a.cc:44:24: error: 'seg' was not declared in this scope
   44 |                 return seg[k];
      |                        ^~~
Language: C++

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


int main() {

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

    int cnt_black=0,cnt_white=0;
    for(int i=0;i<n;i++){
        if(s.at(i)=='#')
            cnt_black++;
        else
            cnt_white++;
    }



    if(s.at(0)=='.'){
        cnt_white--;
        for(int i=0;i<n-1;i++){
            if(s.at(i)=='.'&&s.at(i+1)=='.'){
                cnt_white--;
            }else{
                break;
            }
        }
    }

    if(s.at(n-1)=='#'){
        cnt_black--;
        for(int i=n-1;i>0;i--){
            if(s.at(i)=='#'&&s.at(i-1)=='#'){
                cnt_black--;
            }else{
                break;
            }
        }
    }

    //.#.#.#.#との差分
    if(s.size()%2==0){
        int diff_cnt=0;
        for(int i=0;i<n;i++){
            if(i%2==0){
                if(s.at(i)!='.')
                    diff_cnt++;
            }
            else{
                if(s.at(i)!='#')
                    diff_cnt++;
            }
        }
    }else{
        diff_cnt=s.size();
    }


    cout<<min(cnt_black,min(cnt_white,diff_cnt))<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:9: error: 'diff_cnt' was not declared in this scope
   59 |         diff_cnt=s.size();
      |         ^~~~~~~~
a.cc:63:39: error: 'diff_cnt' was not declared in this scope
   63 |     cout<<min(cnt_black,min(cnt_white,diff_cnt))<<endl;
      |                                       ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(x) x.begin(), x.end()
#define mod 1000000007
typedef long long ll;

int main(){
  int n;
  cin >> n;
  string str;
  cin >> str;
  deque<char> que;
  rep(i, n){
    que.push_back(str[i]);
  }
  while(!que.empry() && que.front() == '.'){
    que.pop_front();
  }
  while(!que.empry() && que.back() == '#'){
    que.pop_back();
  }
  int black = 0;
  int white = 0;
  while(!que.empty()){
    if(que.front() == '.') white++;
    else black++;
    que.pop_front();
  }
  cout << min(black, white);
  return 0;
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: 'class std::deque<char>' has no member named 'empry'; did you mean 'empty'?
   17 |   while(!que.empry() && que.front() == '.'){
      |              ^~~~~
      |              empty
a.cc:20:14: error: 'class std::deque<char>' has no member named 'empry'; did you mean 'empty'?
   20 |   while(!que.empry() && que.back() == '#'){
      |              ^~~~~
      |              empty
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define itn int
#define fi first
#define se second
#define be begin()
#define en end()
#define reverse
const int mod=1000000007;
const int INFi=2147483647;
const long long INFl=9223372036854775807LL;
template<typename T> T abs(T a,T b){
  return max(a,b)-min(a,b);
}
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,ans=0;
  string s;
  cin>>n>>s;
  for(int i=0;i<s.size();i++){
    if(s[i]=='#') ans++;
  }
  cout<<min(ans,s.size()-ans)<<"\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:12: error: no matching function for call to 'min(long long int&, long long unsigned int)'
   25 |   cout<<min(ans,s.size()-ans)<<"\n";
      |         ~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:25:12: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   25 |   cout<<min(ans,s.size()-ans)<<"\n";
      |         ~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:25:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   25 |   cout<<min(ans,s.size()-ans)<<"\n";
      |         ~~~^~~~~~~~~~~~~~~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'else' without a previous 'if'
   11 |   else black[0] = 1; white[0] = 0;
      |   ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'else' without a previous 'if'
   11 |   else black[0] = 1; white[0] = 0;
      |   ^~~~
a.cc:15:30: error: expected ';' before '}' token
   15 |       black[i] = black[i - 1]
      |                              ^
      |                              ;
   16 |     }
      |     ~
Language: C++

// atcoder/tenka1-2019-beginner/C/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; for (auto& i: v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { for (auto& i: v) is >> i; return is; }
template<typename T> ostream& operator << (ostream& os, set<T> s) { os << "#{"; for (auto& i: s) os << i << ","; os << "}"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; for (auto& i: m) os << i << ","; os << "}"; return os; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

using lli = long long int;
using ull = unsigned long long;
using point = complex<double>;
using str = string;
template<typename T> using vec = vector<T>;

constexpr array<int, 8> di({0, 1, -1, 0, 1, -1, 1, -1});
constexpr array<int, 8> dj({1, 0, 0, -1, 1, -1, -1, 1});
constexpr lli mod = 1e9 + 7;

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.setf(ios_base::fixed);
  cout.precision(15);

  str s;
  int _;
  while (cin >> _ >> s) {
    int y = count(t.begin(), t.end(), '#');
    int x = 0;
    for (int i = 1; i < s.size(); ++i) {
      if (s[i - 1] == '#' && s[i] == '.') {
        s[i] = '#';
        ++x;
      }
    }
    cout << min(x, y) << endl;
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:42:19: error: 't' was not declared in this scope
   42 |     int y = count(t.begin(), t.end(), '#');
      |                   ^
Language: C++

N = int(input())
S = input()

left_black = [0] * N
for i in range(N):
    if S[i] == '#':
        left_black[i] += 1
for i in range(N - 1):
    left_black[i+1] = left_black[i] + left_black[i+1]
left_black.insert(0, 0)
# print(left_black)

right_white = [0] * N
for i in range(N):
    if S[i] == '.':
        right_white[i] += 1
for i in range(N-1, 0, -1):
    right_white[i - 1] = right_white[i - 1] + right_white[i]
right_white.append(0)
# print(right_white)

m = 10 ** 6
for i in range(N):
    # if S[i] == '#':
    temp = left_black[i] + right_white[i + 1]
    # print(temp)
    m = min(m, temp)
print(m)



Compiler output:
a.cc:11:3: error: invalid preprocessing directive #print
   11 | # print(left_black)
      |   ^~~~~
a.cc:20:3: error: invalid preprocessing directive #print
   20 | # print(right_white)
      |   ^~~~~
a.cc:24:11: error: token "[" is not valid in preprocessor expressions
   24 |     # if S[i] == '#':
      |           ^
a.cc:24: error: unterminated #if
   24 |     # if S[i] == '#':
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 sc = new Scanner(System.in);
    int n = sc.nextInt();
    String s = sc.next();
    int[] b = new int[n + 1];
    int[] w = new int[n + 1];
    int p = 0;
    for(int i = 0; i < n; i++) {
      if(s.charAt(i) == '.') p++;
    }
    w[0] = p;
    for(int i = 0; i < n; i++) {
      if(s.charAt(i) == '.') { 
        w[i + 1] = w[i] - 1;
      } else {
        b[i + 1] = b[i] + 1;
      }
    }
    int ans = n;
    for(int i = 0; i <= n; i++) {
      ans = Math.min(ans, b[i] + w[i]);
    }
    System.out.println(ans);
  }

Compiler output:
Main.java:27: error: reached end of file while parsing
  }
   ^
1 error
Language: C++

n=int(input())
s=input()
l=[]
k=len(s.replace(".",""))
ans=n-k
#自分含め左にいくつ黒があるか
cnt=0
#左の黒、右の白
for i in range(n):
  cnt+=int(s[i]=="#")
  ans=min(ans,2*cnt+n-i-1-k)
print(ans)

Compiler output:
a.cc:6:2: error: invalid preprocessing directive #\U000081ea\U00005206\U0000542b\U00003081\U00005de6\U0000306b\U00003044\U0000304f\U00003064\U00009ed2\U0000304c\U00003042\U0000308b\U0000304b
    6 | #自分含め左にいくつ黒があるか
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:8:2: error: extended character 、 is not valid in an identifier
    8 | #左の黒、右の白
      |  ^
a.cc:8:2: error: invalid preprocessing directive #\U00005de6\U0000306e\U00009ed2\U00003001\U000053f3\U0000306e\U0000767d
    8 | #左の黒、右の白
      |  ^~~~~~~~~~~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n=int(input())
      | ^
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
const ll mod=1e9+7;
const int inf=1<<30;

int main(){
  int n; cin >> n;
  string s; cin >> s;
  vector<int> w(n);
  vector<int> ws(n);
  rep(i,n){
    if(s[i]=='#') w[i]=1;
  }
  ws[0]=w[0];
  for(int i=1;i<n;i++){
    ws[i]=ws[i-1]+w[i];
  }
  vector<int> b(n);
  vector<int> bs(n);
  for(int i=n-1;i>=0;i--){
    if(s[i]=='.') b[i]=1;
  }
  bs[n-1]=b[n-1];
  for(int i=n-2;i>=0;i--){
    bs[i]=bs[i+1]+b[i];
  }
  int ans=min(bs[0],ws[n-1]);
  rep(i,n-1){
    chmin(ans,ws[i]+bs[i+1]);b
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:31: error: expected ';' before '}' token
   37 |     chmin(ans,ws[i]+bs[i+1]);b
      |                               ^
      |                               ;
   38 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll n;
  cin>>n;
  string s;
  cin>>s;
  ll ku=0;
  ll si=0;
  while(s[sz(s)-1]=='#'){
    s.pop_back();
    n--;
  }
  vector<pll> a(n);
  rep(i,n){
    if(s[i]=='#') ku++;
    if(s[i]=='.') si++;
  }
  ll kuro=0;
  ll siro=0;
  rep(i,n){
    if(s[i]=='#'){
      kuro++;
      p[i].F=kuro;
    }
    else{
      siro++;
      p[i].S=siro;
    }
  }
  ll ans=INF;
  rep(i,n){
    ans=min(ans,p[i].F+si-p[i].S);
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:7: error: 'p' was not declared in this scope
   63 |       p[i].F=kuro;
      |       ^
a.cc:67:7: error: 'p' was not declared in this scope
   67 |       p[i].S=siro;
      |       ^
a.cc:72:17: error: 'p' was not declared in this scope
   72 |     ans=min(ans,p[i].F+si-p[i].S);
      |                 ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <cstring>
#include <iomanip>
#include <utility>
 
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n) for(int i=1;i<=(n);i++)
#define lol long long
#define SUM(n) ((n)+1)*(n)/2
#define mp make_pair
#define fi first
#define se second
#define pu push_back
#define SYOU(x) setprecision(x+1)
#define abs(x,y) (max(x,y)-min(x,y))
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const int MOD=int(1e9)+7; 
using namespace std;

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

    int n;
    string s;
    cin >> n >> s;
    int ans = 0;
    rep(i,s.size()){
      if(s[i] == '#' && s[i+1] == '.') {
	ans++;
      } 

    cout << ans << '\n';
    
    return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int i,j,n,m;
  cin>>n;
  char str[n];
  bool ok=false;
  int p=0;
  for(i=0;i<n;i++)
  {
    
     cin>>str[i];
    if(str[i+1]==".")ok=true;
    if(str[i+1]=="#"&&ok)p++;
    
  }
  cout<<p<<endl;
  
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(str[i+1]==".")ok=true;
      |        ~~~~~~~~^~~~~
a.cc:15:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     if(str[i+1]=="#"&&ok)p++;
      |        ~~~~~~~~^~~~~
Language: C++

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

int main(){
  int n; cin >> n;
  string s; cin >> s;
  vector<int> cumb(n+1);
  vecotr<int> cumw(n+1);
  cumb.at(0) = 0;
  for(int i=0; i<n; i++){
    if(s.at(i)=='#'){
      cumb.at(i+1) = cumb.at(i)++;
    }else{
      cumb.at(i+1) = cumb.at(i);
    }
  }
  comw.at(n) = 0;
  for(int i=0; i<n; i++){
    if(s.at(n-1-i)=='.'){
      cumw.at(n-i) = cumw.at(n-1-i)++;
    }else{
      cumw.at(n-1) = cumw.at(n-1-i);
    }
  }
  int ans = 1000000000;
  for(int i=0; i<=n; i++){
    ans = min(ans, cumw.at(i)+cumb.at(i));
  }
  cout << ans <<endl;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vecotr' was not declared in this scope
    8 |   vecotr<int> cumw(n+1);
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vecotr<int> cumw(n+1);
      |          ^~~
a.cc:17:3: error: 'comw' was not declared in this scope
   17 |   comw.at(n) = 0;
      |   ^~~~
a.cc:20:7: error: 'cumw' was not declared in this scope; did you mean 'cumb'?
   20 |       cumw.at(n-i) = cumw.at(n-1-i)++;
      |       ^~~~
      |       cumb
a.cc:22:7: error: 'cumw' was not declared in this scope; did you mean 'cumb'?
   22 |       cumw.at(n-1) = cumw.at(n-1-i);
      |       ^~~~
      |       cumb
a.cc:27:20: error: 'cumw' was not declared in this scope; did you mean 'cumb'?
   27 |     ans = min(ans, cumw.at(i)+cumb.at(i));
      |                    ^~~~
      |                    cumb
Language: C++

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

Compiler output:
a.cc:12:24: error: stray '#' in program
   12 |        if(s[i+1]=='.'){#include<bits/stdc++.h>
      |                        ^
a.cc: In function 'int32_t main()':
a.cc:12:25: error: 'include' was not declared in this scope
   12 |        if(s[i+1]=='.'){#include<bits/stdc++.h>
      |                         ^~~~~~~
a.cc:12:33: error: 'bits' was not declared in this scope
   12 |        if(s[i+1]=='.'){#include<bits/stdc++.h>
      |                                 ^~~~
a.cc:12:38: error: 'stdc' was not declared in this scope; did you mean 'std'?
   12 |        if(s[i+1]=='.'){#include<bits/stdc++.h>
      |                                      ^~~~
      |                                      std
a.cc:13:1: error: expected primary-expression before 'using'
   13 | using namespace std;
      | ^~~~~
a.cc:15:13: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   15 | int32_t main(){
      |             ^~
a.cc:15:13: note: remove parentheses to default-initialize a variable
   15 | int32_t main(){
      |             ^~
      |             --
a.cc:15:13: note: or replace parentheses with braces to value-initialize a variable
a.cc:15:15: error: a function-definition is not allowed here before '{' token
   15 | int32_t main(){
      |               ^
Language: C++

/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/


int main() {
	
	int n;
	string s;
	scanf("%d", &n);
	scans(s);
	int white = 0, flag = 0;
	rep(i, n){
		if(i < n - 1)if(s[i] == '#' && s[i + 1] ==  '.')flag = i;
		if(flag)white += (aa == '.');
	}
	printf("%d\n", min(white, (n - flag + ) - white));
	
	Please AC;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:96:35: error: 'aa' was not declared in this scope
   96 |                 if(flag)white += (aa == '.');
      |                                   ^~
a.cc:98:47: error: expected primary-expression before ')' token
   98 |         printf("%d\n", min(white, (n - flag + ) - white));
      |                                               ^
Language: C++

/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/


int main() {
	
	int n;
	string s;
	scanf("%d", &n);
	scans(s);
	int white = 0, flag = 0;
	rep(i, n){
		if(i < n - 1)if(s[i] == '#' && s[i + 1] ==  '.')flag = i;
		if(flag)white += (aa == '.');
	}
	printf("%d\n", min(white, (n - flag) - white));
	
	Please AC;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:96:35: error: 'aa' was not declared in this scope
   96 |                 if(flag)white += (aa == '.');
      |                                   ^~
Language: C++

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

int main(){
  int i,j,cnt=0;
  int n;
  cin>>n;
  string s;
  cin>>s;
  s+='#';
  int rw=w,lb=0,mi=INT_MAX;
  for(i=0;i<=n;i++){
    if(s[i]=='#'){
      lb++;
    }else{
      rw--;
    }
    mi=min(lb+rw,mi);
  }
  cout<<mi<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'w' was not declared in this scope; did you mean 'rw'?
   12 |   int rw=w,lb=0,mi=INT_MAX;
      |          ^
      |          rw
a.cc:15:7: error: 'lb' was not declared in this scope; did you mean 'll'?
   15 |       lb++;
      |       ^~
      |       ll
a.cc:19:5: error: 'mi' was not declared in this scope; did you mean 'i'?
   19 |     mi=min(lb+rw,mi);
      |     ^~
      |     i
a.cc:19:12: error: 'lb' was not declared in this scope; did you mean 'll'?
   19 |     mi=min(lb+rw,mi);
      |            ^~
      |            ll
a.cc:21:9: error: 'mi' was not declared in this scope; did you mean 'i'?
   21 |   cout<<mi<<endl;
      |         ^~
      |         i
Language: C++

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

int main(){
  string s;
  cin >> s;
  int out = 0;
  int count = 0;
  for(int i = 0; i < s.size(); i++){
    if(i == 0){
      for(int j = 0; j < s.size(); j++){
        if(s.at(j) == '.') count++;
        out = count;
      }else{
        if(s.at(i - 1) == '.' & s.at(i) == '.'){
          count--;
        }else if(s.at(i - 1) == '#' & s.at(i) == '#'){
          count++;
        }else if(s.at(i - 1) == '.' & s.at(i) == '#'){
          count--;
        }else if(s.at(i - 1) == '#' & s.at(i) == '.'){
          count++;
        }
        if(out > count){
          out = count;
        }
      }
    }
  }
  cout << out;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: expected '}' before 'else'
   14 |       }else{
      |        ^~~~
a.cc:10:15: note: to match this '{'
   10 |     if(i == 0){
      |               ^
a.cc: At global scope:
a.cc:30:3: error: 'cout' does not name a type
   30 |   cout << out;
      |   ^~~~
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^