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

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

 int main()
 {
 	int n, t, a[100010];
 	cin >> n >> t;
 	for (int i = 0; i < n; i++) cin >> a[i];
     
     long long p[100010] = {}, mi = 1 << 30;
     for (int i = 0; i < n; i++) {
     	mi = min(mi, a[i]);
     	p[i] = a[i] - mi;
     }
     
     sort(p, p + n);
     reverse(p, p + n);
     // for (int i = 0; i < n; i++) cerr << p[i] << endl;
     int cnt = 0;
     for (int i = 0; i < n && p[i] == p[0]; i++, cnt++);
     cout << cnt << endl;
     
     return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: no matching function for call to 'min(long long int&, int&)'
   12 |         mi = min(mi, a[i]);
      |              ~~~^~~~~~~~~~
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:12:17: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   12 |         mi = min(mi, a[i]);
      |              ~~~^~~~~~~~~~
/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:12:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   12 |         mi = min(mi, a[i]);
      |              ~~~^~~~~~~~~~
Language: C++

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

long long gcd(long long aaa,long long bbb) {
    if(bbb==0) {
        return aaa;
    }
    return gcd(bbb,aaa%bbb);
}

int main (){

    ll N,T,M=0,ans=1,cmp=0,tmppp=0;
    cin >> N >> T;
    ll A[N],tmp,tmpp,mi[N],ma[N];
    for(ll i = 0; i < N; i++) {
        cin >> A[i];
        if(i != 0) {
            tmp = min(tmp,A[i]);
            mi[i] = tmp;
        }else {
            tmp = A[i];
            m[i] = tmp;
        }
    }

    reverse(A,A+N);
    tmp = 0;
    for(ll i = 0; i < N; i++) {
        tmp = max(tmp,A[i]);
        ma[i] = tmp;
    }

    for(ll i = 0; i < N-1; i++) {
        cmp = (ma[N-2-i]*(T/2))-(mi[i]*(T/2));
        if (M == cmp) {
            ans++;
            if(mi[i] == tmppp) {
                ans--;
            }else {
                tmppp = mi[i];
            }
        } else if (M < cmp) {
            M = cmp;
            ans = 1;
            tmppp = mi[i];
        }
    }
    cout << ans << endl;
    return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long int

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, T;
    cin >> N >> T;
    int a[N];
    rep(i, N) cin >> a[i];
    int MAXyen = 0;
    int i = 0, j = 0;
    while(i < N) {
        if (j == N) {
            MAXyen = max(MAXyen, max((ll)0, a[j-1] - a[i]));
            break;
        }
        if (a[i] <= a[j]) {
            j++;
            continue;
        } else {
            MAXyen = max(MAXyen, max((ll)0, a[j-1] - a[i]));
            i = j;
            continue;
        }
    }
    //dump(MAXyen);
    i = 0, j = 0;
    int ans = 0;
    while(i < N) {
        if (j == N) {
            if (MAXyen == a[j-1] - a[i]) ans++;
            break;
        }
        if (a[i] <= a[j]) {
            j++;
            continue;
        } else {
            if (MAXyen == a[j-1] - a[i]) ans++;
            i = j;
            continue;
        }
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'long long long' is too long for GCC
    9 | #define int long long int
      |             ^~~~
a.cc:3:22: note: in expansion of macro 'int'
    3 | #define ll long long int
      |                      ^~~
a.cc:23:39: note: in expansion of macro 'll'
   23 |             MAXyen = max(MAXyen, max((ll)0, a[j-1] - a[i]));
      |                                       ^~
a.cc:9:18: error: 'long long long' is too long for GCC
    9 | #define int long long int
      |                  ^~~~
a.cc:3:22: note: in expansion of macro 'int'
    3 | #define ll long long int
      |                      ^~~
a.cc:23:39: note: in expansion of macro 'll'
   23 |             MAXyen = max(MAXyen, max((ll)0, a[j-1] - a[i]));
      |                                       ^~
a.cc:9:13: error: 'long long long' is too long for GCC
    9 | #define int long long int
      |             ^~~~
a.cc:3:22: note: in expansion of macro 'int'
    3 | #define ll long long int
      |                      ^~~
a.cc:30:39: note: in expansion of macro 'll'
   30 |             MAXyen = max(MAXyen, max((ll)0, a[j-1] - a[i]));
      |                                       ^~
a.cc:9:18: error: 'long long long' is too long for GCC
    9 | #define int long long int
      |                  ^~~~
a.cc:3:22: note: in expansion of macro 'int'
    3 | #define ll long long int
      |                      ^~~
a.cc:30:39: note: in expansion of macro 'll'
   30 |             MAXyen = max(MAXyen, max((ll)0, a[j-1] - a[i]));
      |                                       ^~
Language: C++

#include <iostream>
#include<sstream>
#include<vector>
#include<iterator>
#include<algorithm>
using namespace std;

int main(void)
{
	int N, T;
	cin >> N >> T;
	
	vector<long long> A(N);
	for(int i=0; i<N; i++)
		cin >> A[i];

	long long y = A[0];
	vector<long long> b(N);
	for(int i=0; i<N; i++)
	{
		y = min(y, A[i]);
		b[i] = A[i] - y;
	}

	long long maxb = *max_element(b.begin(), b.end());
	int ret = count(b.begin(), b.end(), maxb);

	cout << ret << endl;

	return 0;
}

	long long maxb = *max_element(b.begin(), b.end());
	int ret = count(b.begin(), b.end(), maxb);

	cout << ret << endl;

	return 0;
}


Compiler output:
a.cc:33:39: error: 'b' was not declared in this scope
   33 |         long long maxb = *max_element(b.begin(), b.end());
      |                                       ^
a.cc:33:50: error: 'b' was not declared in this scope
   33 |         long long maxb = *max_element(b.begin(), b.end());
      |                                                  ^
a.cc:34:25: error: 'b' was not declared in this scope
   34 |         int ret = count(b.begin(), b.end(), maxb);
      |                         ^
a.cc:34:36: error: 'b' was not declared in this scope
   34 |         int ret = count(b.begin(), b.end(), maxb);
      |                                    ^
a.cc:36:9: error: 'cout' does not name a type
   36 |         cout << ret << endl;
      |         ^~~~
a.cc:38:9: error: expected unqualified-id before 'return'
   38 |         return 0;
      |         ^~~~~~
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int N, T, tmp, i, dif = 0, difnum = 0;
	vector<int> Ai;
	cin >> N >> T;
	for (i = 0; i < N; ++i)
	{
		cin >> tmp;
		Ai.push_back(tmp);
	}
	for (i = 0; i < N; ++i)
	{
		for (int j = 0; j < N - i - 1; ++j)
		{
			if (Ai[j] - Ai[i] > dif)
			{
				dif = Ai[j] - Ai[i];
				difnum = 1;
			}
			if (Ai[j] - Ai[i] == dif)
				++difnum:
		}
	}
	cout << difnum;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:41: error: expected ';' before ':' token
   23 |                                 ++difnum:
      |                                         ^
      |                                         ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
 int n,t,count=0,max=0;
 int a[100000]={};
 cin>>n>>t;
 for(int i=0;i<n;i++)cin>>a[i];
 int min=a[0];
 for(int i=1;i<n;i++){
  if(a[i]<min)min=a[i];
  if(a[i-1]<a[i])
   if(a[i]-min>max){
    max=a[i]-min;
    count=0;
   }
   else (a[i]-min==max)count++;
}
 cout<<count<<endl;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:24: error: expected ';' before 'count'
   16 |    else (a[i]-min==max)count++;
      |                        ^~~~~
      |                        ;
Language: C++

#include <iostream>
#include <array>
#include <vector>

using std::cin;
using std::cout;
using std::endl;
using std::vector;
using std::max;
using std::max_element;
using std::count;

int main()
{
  int N, T, maxProfit = 0;

  cin >> N >> T;

  vector<int> prices;
  vector<int> maxProfits;

  for(int i = 0; i < N; i++) {
    int price;
    cin >> price;
    prices.push_back(price);
  }

  for(int i = 0; i < N - 1; i++) {
    vector<int> profits;

    // j starts from after i
    for(int j = i + 1; j < N; j++) {
      int profit = prices[j] - prices[i];
      if(maxProfit <= profit) {
        profits.push_back(profit);
      }
    }

    if(profits.size() > 0) {
      maxProfit = *max_element(profits.begin(), profits.end());

      int cnt = count(profits.begin(), profits.end(), maxProfit);

      for(int i = 0; i < cnt; i++) {
        maxProfits.push_back(maxProfit);
      }
    }
  }

  cout << count(maxProfits.begin(), maxProfits.end(), *max_element(maxProfits.begin(), maxProfits.end())) << endl;
}


Compiler output:
a.cc:10:12: error: 'max_element' has not been declared in 'std'
   10 | using std::max_element;
      |            ^~~~~~~~~~~
a.cc:11:12: error: 'count' has not been declared in 'std'
   11 | using std::count;
      |            ^~~~~
a.cc: In function 'int main()':
a.cc:40:20: error: 'max_element' was not declared in this scope
   40 |       maxProfit = *max_element(profits.begin(), profits.end());
      |                    ^~~~~~~~~~~
a.cc:42:17: error: 'count' was not declared in this scope; did you mean 'cout'?
   42 |       int cnt = count(profits.begin(), profits.end(), maxProfit);
      |                 ^~~~~
      |                 cout
a.cc:50:56: error: 'max_element' was not declared in this scope
   50 |   cout << count(maxProfits.begin(), maxProfits.end(), *max_element(maxProfits.begin(), maxProfits.end())) << endl;
      |                                                        ^~~~~~~~~~~
a.cc:50:11: error: 'count' was not declared in this scope; did you mean 'cout'?
   50 |   cout << count(maxProfits.begin(), maxProfits.end(), *max_element(maxProfits.begin(), maxProfits.end())) << endl;
      |           ^~~~~
      |           cout
Language: C

#include <stdio.h>
int main(void){
	int n,t,a[100000],i,j,max=-114514,ans=0;
	scanf("%d %d",&n,&t);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			max=max>a[j]-a[i]?max:a[j]-a[i];
	}
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			if(a[j]-a[i]==max){
				ans++;
			}
		}
	}
	printf("%d\n",ans);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:1: error: expected declaration or statement at end of input
   21 | }
      | ^
Language: C++

#include <stdlib.h>
#include <iostream>
using namespace std;


int main(){
	int n;
	int t;
	cin >> n >> t;

	int *a = (int*)malloc(n * sizeof(int));
	int *mina = (int*)malloc(n * sizeof(int));
	int minv = INT_MAX;

	for(int i = 0; i < n; i++){
		cin >> a[i];
		if(minv > a[i]) minv = a[i];
		mina[i] = minv;
	}

	int this_dif = 0;
	int max_dif  = 0;
	int dif_num  = 0;

	for(int i = 1; i < n; i++){
		this_dif = a[i] - mina[i];
		if(this_dif > max_dif){
			max_dif = this_dif;
			dif_num = 1;
		}else if(this_dif == max_dif){
			dif_num++;
		}
	}
	cout << min(dif_num, t/2) << endl;
	return 0;
}



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

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

int main() {
  int N, T;
  cin >> N >> T;

  int mini;
  cin >> mini;
  int maxi=0;
  vector<int> A(n);
  A[0] = 0;
  for (int i=1; i<N; i++) {
     cin >> A[i];
    if (mini > A[i]) mini = A[i];
    A[i] -= mini;
    if (maxi < A[i]) maxi = A[i];
  }

  int ans=0;
  for (int i=0; i<N; i++) {
    if (maxi == A[i]) ans++;
  }

  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'n' was not declared in this scope
   12 |   vector<int> A(n);
      |                 ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
using li = long int;

#define MAX_N 10000
int n;
int a[MAX_N] = {0};
int diff[MAX_N] = {0};
int mins[MAX_N] = {0};
int t;

void solve(){
    int tmp_min = a[0];

    for(int i = 0; i < n - 1; i++){
        mins[i] = min(tmp_min, a[i]);
        tmp_min = mins[i];
    }

    diff[0] = 0;
    li max_diff = 0;

    for(int i = 1; i < n; i++){
        diff[i] = a[i] - mins[i - 1];
        max_diff = max(max_diff, diff[i]);
    }

    int count = 0;
    for(int i = 1; i < n; i++){
        if (diff[i] == max_diff) count++; 
    }
    cout << count << endl;
    return ;
}


int main(){
    cin >> n >> t;
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:26:23: error: no matching function for call to 'max(li&, int&)'
   26 |         max_diff = max(max_diff, diff[i]);
      |                    ~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:26:23: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   26 |         max_diff = max(max_diff, diff[i]);
      |                    ~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:26:23: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   26 |         max_diff = max(max_diff, diff[i]);
      |                    ~~~^~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <cstdlib>
#define NMAX 100000
#define MMAX 10000
using namespace std;
vector<int > group[NMAX];
int main(){
	int N,T,A[NMAX] = {},dif[NMAX] = {},most = 0,first,end = 0,num = 0,gr_num = 0;
	cin >> N >> T;
	for (int i = 0; i < N; ++i)
	{
		cin >> A[i];
		if(i == 0){
			first = A[i];
			group[gr_num].push_back(A[i]);
		}else if(first < A[i]){
			group[gr_num].push_back(A[i]);
			if(i == N-1){
				sort(group[gr_num].begin(), group[gr_num].end());
				dif[gr_num] = group[gr_num][group[gr_num].size()-1]-group[gr_num][0];
				most = max(most,dif[gr_num]);
			}
		}else{
			first = A[i];
			sort(group[gr_num].begin(), group[gr_num].end());
			dif[gr_num] = group[gr_num][group[gr_num].size()-1]-group[gr_num][0];
			most = max(most,dif[gr_num]);
			gr_num++;
			group[gr_num].push_back(A[i]);
		}
	}
	// for (int i = 0; i <= gr_num; ++i)
	// {
	// 	for (int j = 0; j < group[i].size(); ++j)
	// 	{
	// 		cout << group[i][j] << " ";
	// 	}
	// 	cout << dif[i];
	// 	cout << "\n";
	// }
	for (int i = 0; i < N; ++i)
	{
		if(dif[i] == most){
			num += /*dif_num[i]*/1;
			// cout << dif_num[i] << "\n";
		}
	}
	// cout << dif_num[N-1] << "\n";
	cout << num << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:33: error: 'sort' was not declared in this scope; did you mean 'short'?
   22 |                                 sort(group[gr_num].begin(), group[gr_num].end());
      |                                 ^~~~
      |                                 short
a.cc:28:25: error: 'sort' was not declared in this scope; did you mean 'short'?
   28 |                         sort(group[gr_num].begin(), group[gr_num].end());
      |                         ^~~~
      |                         short
Language: C++

//
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <array>
#include <numeric>
#include <functional>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<utility>
#include<complex>

using namespace std;

#define REP(i,m,n) for(int i=m;i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define ALL(x) (x).begin(),(x).end()

int main(){
	int n,t;
	cin >> n >> t;
	vector<int> a(n), diff;
	rep(i,n){
		cin >> a[i];
	}

	for(int i=0; i<n; i++){
		for(int j=i+1; j<n; j++){
			int val = a[j] - a[i]
			if(val >0)	diff.push_back(a[j]-a[i]);
		}
	}
	int counter = 1;
	sort(ALL(diff), std::greater<int>());
	int max = diff[0];
	REP(i,1,diff.size()){
		if(max == diff[i]) counter++;
		else break;
	}
	if(t >= 2*counter) cout << counter << endl;
	else cout << min(t, counter) << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:25: error: expected ',' or ';' before 'if'
   37 |                         if(val >0)      diff.push_back(a[j]-a[i]);
      |                         ^~
Language: C++

//
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <array>
#include <numeric>
#include <functional>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<utility>
#include<complex>

using namespace std;

#define REP(i,m,n) for(int i=m;i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define ALL(x) (x).begin(),(x).end()

int main(){
	int n,t;
	cin >> n >> t;
	vector<int> a(n), diff;
	rep(i,n){
		cin >> a[i];
	}

	for(int i=0; i<n; i++){
		for(int j=i+1; j<n; j++){
			int val = a[j] - a[i]
			if(val)	diff.push_back(a[j]-a[i]);
		}
	}
	int counter = 1;
	sort(ALL(diff), std::greater<int>());
	int max = diff[0];
	REP(i,1,diff.size()){
		if(max == diff[i]) counter++;
		else break;
	}
	if(t >= 2*counter) cout << counter << endl;
	else cout << min(t, counter) << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:25: error: expected ',' or ';' before 'if'
   37 |                         if(val) diff.push_back(a[j]-a[i]);
      |                         ^~
Language: C

#include<stdio.h>

int main()
{
	int n,t;
	int i,j;
	int c=0;
	int g=0;
	int min;
	
	if(scanf("%d %d",&n,&t) < 2) {
    fprintf(stderr, "error: ill-formed fraction.\n");
    exit(1);
	}
	
	int a[n];
	
	for(i=0;i<n;i++){
		if(scanf("%d",&a[i]) < 1) {
    fprintf(stderr, "error: ill-formed fraction.\n");
    exit(1);
		}
	}
	
	min = a[0];
	for(i=1;i<n;i++){
		if(min>a[i]){
			min=a[i];
		}else if(a[i]-min>g){
			c=1;
			g=a[i]-mig;
		}else if(a[i]-min==g){
			c++;
		}
	}
	
	printf("%d\n",c);
	
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:5: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   13 |     exit(1);
      |     ^~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:13:5: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   13 |     exit(1);
      |     ^~~~
main.c:13:5: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:21:5: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   21 |     exit(1);
      |     ^~~~
main.c:21:5: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:31:32: error: 'mig' undeclared (first use in this function); did you mean 'min'?
   31 |                         g=a[i]-mig;
      |                                ^~~
      |                                min
main.c:31:32: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <map>
#include <algorithm>
using namespace std;

int main(){
  int n,t;
  cin >> n >> t;
  vector<int> a(n);
  int alocal=1e9+1;
  ai[0]=0;
  int ans=0;
  int local =0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if(alocal>a[i]){
      alocal=a[i];
    }
    if(a[i]-alocal>local){
      local=a[i]-alocal;
      ans=1;
    }else if(a[i]-alocal == 0){
      ans++;
    }
  }
  cout <<ans <<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'ai' was not declared in this scope; did you mean 'a'?
   16 |   ai[0]=0;
      |   ^~
      |   a
Language: C++

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;

#define REP(i,n) for(int i = 0; i < n; i++)
#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 pi acos(-1.0)

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

VI a;

int main(){
    int n, t;
    int a_min = INT_MAX;
    int b_max = INT_MIN;
    int ans = 1;
    cin >> n >> t;
    REP(i,n){
        int temp;
        cin >> temp;
        a.push_back(temp);
    }

    REP(i,n-1){
        if(a[i] < a_min) a_min = a[i];
        if(b_max < a[i+1] - a_min){
            b_max = a[i+1] - a_min;
        }else if(b_max == a[i+1] - a_min){
            ans++;
        }
    }
    
    if(ans > t/2)
        ans = t/2;
    
    cout << ans << endl;
    return 0;
}










Compiler output:
a.cc: In function 'int main()':
a.cc:31:17: error: 'INT_MAX' was not declared in this scope
   31 |     int a_min = INT_MAX;
      |                 ^~~~~~~
a.cc:13:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   12 | #include <algorithm>
  +++ |+#include <climits>
   13 | using namespace std;
a.cc:32:17: error: 'INT_MIN' was not declared in this scope
   32 |     int b_max = INT_MIN;
      |                 ^~~~~~~
a.cc:32:17: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define LOG(...) fprintf(stderr, __VA_ARGS__)
// #define LOG(...)
#define FOR(i, a, b) for(int i = (int)(a); i < (int)(b); ++i)
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define RREP(i, n) for(int i = (int)(n - 1); i >= 0; --i)
#define RFOR(i, a, b) for(int i = (int)(b - 1); i >= (int)(a); --i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SQ(n) (n) * (n)
#define BIT(x, i) (((x) >> (i)) & 1)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vc> vvc;
typedef vector<vll> vvll;

int main() {
  int N, T;
  cin >> N >> T;
  T /= 2;

  vll apples(N);
  REP(i, N) {
    cin >> apples[i];
  }

  vll maxd(N, -1);
  ll maxv = 0;
  RREP(i, N) {
    maxv = max(maxv, apples[i]);
    maxd[i] = maxv - apples[i];
  }

  gain gain = 0;
  int cnt = 0;
  REP(i, N) {
    ll d = maxd[i];
    if (gain == d) {
      cnt++;
    } else if(gain < d) {
      gain = d;
      cnt = 1;
    }
  }

  // REP(i, N - 1) FOR(j, i + 1, N) {
  //   int d = apples[j] - apples[i];
  //   if (gain == d) {
  //     cnt++;
  //   } else if(gain < d) {
  //     gain = d;
  //     cnt = 1;
  //   }
  // }


  cout << min(cnt, T) << endl;
  // LOG("gain %d, n %d\n", gain, cnt);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:3: error: 'gain' was not declared in this scope; did you mean 'main'?
   51 |   gain gain = 0;
      |   ^~~~
      |   main
Language: C++

#include <iostream>

int main(){
  long long int N, T;
  long long int A[100000], B[100000], C[100000];
  long long int min, max, cnt; 

  std::cin >> N >> T;

  for(int i=0; i<N; i++){
    std::cin >> A[i];
  }

  for(int i=0; i<N; i++){
    for(int int j=i; j<N; j++){
      if(max < A[i]-A[j]) max = A[j]-A[i];
    }
    B[i]=max;
    C[i]=j; 
  }

  std::sort(B, B+100000);
  for(int i=N-2; i>=0; i--){
    if(B[N-1] == B[i] && C[N-1] == C[i]) cnt++;
  }

std::cout << cnt << std::endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: two or more data types in declaration of 'j'
   15 |     for(int int j=i; j<N; j++){
      |         ^~~
a.cc:15:22: error: 'j' was not declared in this scope
   15 |     for(int int j=i; j<N; j++){
      |                      ^
a.cc:19:10: error: 'j' was not declared in this scope
   19 |     C[i]=j;
      |          ^
a.cc:22:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   22 |   std::sort(B, B+100000);
      |        ^~~~
      |        qsort
Language: C++

#include <cstdio>
using namespace std;

int n, t;
int a[100000];

int p[100000][100000];
int m;

int ans;

int main(){
	scanf("%d %d", &n, &t);
	for(int i=0; i<n; i++) scanf("%d", &a[i]);
	int s = t / 2;

	for(int i=0; i<n-1; i++){
		for(int j=1; i+j<=n-1; j++){
			p[i][i+j] = s * (a[i+j] - a[i]);
			if(m == p[i][i+j]){
				ans++;
			}else if(m < p[i][i+j]){
				m = p[i][i+j];
				ans = 1;
			}
		}
	}
	
	printf("%d\n", ans);

	return 0;
}

Compiler output:
/tmp/ccXAbMqj.o: in function `main':
a.cc:(.text+0x136): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccXAbMqj.o
a.cc:(.text+0x140): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccXAbMqj.o
a.cc:(.text+0x149): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccXAbMqj.o
a.cc:(.text+0x17d): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccXAbMqj.o
a.cc:(.text+0x1b3): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccXAbMqj.o
a.cc:(.text+0x1b9): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccXAbMqj.o
a.cc:(.text+0x1f3): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccXAbMqj.o
collect2: error: ld returned 1 exit status
Language: C

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

int main(){
    int N,T;
    scanf("%d %d",&N,&T);
    if(T < 2){
        printf("0\n");
        return 0;
    }
    int * cost = malloc(N*sizeof(int));
    int i;
    for(i = 0; i < N; i++){
        scanf("%d",&cost[i]);
    }
    
    //find max profit
    int j;
    int max = 0;
    for(i = 0; i < N-1; i++){
        for(j = i+1; j<N; j++){
            int diff = cost[j]-cost[i];
            if(diff>max){
                max = (cost[j]-cost[i]);
                count = 0;
            }else if(diff == max){
                count++;
            }
            
        }
    }
    

    printf("%d\n",count);
    return EXIT_SUCCESS;
}

Compiler output:
main.c: In function 'main':
main.c:25:17: error: 'count' undeclared (first use in this function)
   25 |                 count = 0;
      |                 ^~~~~
main.c:25:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <cstdio>
#include <algorithm>
#include <set>
#include <vector>
using namespace std;

int n, t;
int a[100000];

int p[100000][100000];
int m;

int ans;

int main(){
	scanf("%d %d", &n, &t);
	for(int i=0; i<n; i++) scanf("%d", &a[i]);
	int s = t / 2;

	for(int i=0; i<n-1; i++){
		for(int j=1; i+j<=n-1; j++){
			p[i][i+j] = s * (a[i+j] - a[i]);
//			printf("%d %d %d\n", i, i+j, p[i][i+j]);
			if(m == p[i][i+j]){
				ans++;
			}else if(m < p[i][i+j]){
				m = p[i][i+j];
				ans = 1;
			}
		}
	}
	
	printf("%d\n", ans);

	return 0;
}

Compiler output:
/tmp/ccKGdGmU.o: in function `main':
a.cc:(.text+0x136): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccKGdGmU.o
a.cc:(.text+0x140): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccKGdGmU.o
a.cc:(.text+0x149): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccKGdGmU.o
a.cc:(.text+0x17d): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccKGdGmU.o
a.cc:(.text+0x1b3): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccKGdGmU.o
a.cc:(.text+0x1b9): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccKGdGmU.o
a.cc:(.text+0x1f3): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccKGdGmU.o
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>

#define int long long

int main() {
    int n, t;
    std::cin >> n >> t;
    
    int maxDiff = 0, maxCount = 0;
    
    int nowMin = 0;
    std::cin >> nowMin;
    int prev = nowMin;
    for (int i = 1; i <= n; ++i) {
        int a;
        if (i != n)
            std::cin >> a;
        else
            a = prev - 1;
        
        if (a < prev) {
            if (maxDiff < prev - nowMin)
                maxDiff = prev - nowMin, maxCount = 1;
            else if (maxDiff == prev - nowMin)
                ++maxCount;
            
            nowMin = a;
        }
        
        prev = a;
    }
    
    std::cout << maxCount << std::endl;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
		int t = sc.nextInt();
		int a[] = new a[n];
		for(int i=0; i<n; i++){
			a[i] = sc.nextInt();
		}
		int maxsa = 0;
		int maxa = 0;
		int sa = 0;
		int counter = 0;
		for(int i=0; i<n; i++){
			for(int j=i+1; j<n; j++){
				if(maxa < a[j]){
					maxa = a[j];
				}
			}
			sa = maxa - a[i];
			if(maxsa < sa){
				maxsa = sa;
				counter = 1;
			}
			if(maxsa == sa){
				counter = counter + 1;
			}
			maxa = 0;
		}
		System.out.println(counter);
}
}


Compiler output:
Main.java:8: error: cannot find symbol
		int a[] = new a[n];
		              ^
  symbol:   class a
  location: class Main
1 error
Language: C++

#include <iostream>
#include <vector>

typedef signed long long int slli;

int main()
{
  unsigned N; slli T;
  std::cin >> N >> T;
  
  std::vector<slli> A(N);
  for(unsigned n=0; n<N; ++n)
  {
    std::cin >> A[n];
  }
  
  if(N == 1)
  {
    std::cout << 0 << std::endl;
    return 0;
  }
  
  std::vector<char> C(N-1);
  for(unsigned n=0; n<N-1; ++n)
  {
    C[n] = (A[n] < A[n+1]) ? 'U' : 'D';
  }
  
  /*
  for(unsigned n=0; n<N-1; ++n)
  {
    std::cerr << C[n];
    if(n + 1 < N - 1) std::cerr << ' ';
  }
  std::cerr << std::endl;
  */
  
  unsigned i = 0;
  while(C[i] != 'D') ++i;
  
  unsigned c = 0;
  char x = C[i];
  for(unsigned n=i; n<N-1; ++n)
  {
    if(C[n] != x)
    {
      if(x == 'D') ++c;
      x = C[n];
    }
  }
  std::cout << std::min(c, T) << std::endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:24: error: no matching function for call to 'min(unsigned int&, slli&)'
   51 |   std::cout << std::min(c, T) << std::endl;
      |                ~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:51:24: note:   deduced conflicting types for parameter 'const _Tp' ('unsigned int' and 'slli' {aka 'long long int'})
   51 |   std::cout << std::min(c, T) << std::endl;
      |                ~~~~~~~~^~~~~~
/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
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;
 
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
 
  int n,t;
  cin >> n >> t;
  ll dif=0,res=0,a[n];
  for(int i=0;i<n;i++) cin  >> a[i];
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      if(dif<a[j]-a[i]){
        dif=a[j]-a[i];
        res=1;
　　i=j;
        break;
      }
      else if(dif==a[j]-a[i]) res++;
      else continue;
    }
  }
  cout << res << endl;
}

Compiler output:
a.cc:27:1: error: extended character 　 is not valid in an identifier
   27 | 　　i=j;
      | ^
a.cc:27:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:27:1: error: '\U00003000\U00003000i' was not declared in this scope
   27 | 　　i=j;
      | ^~~~~
Language: C++

#include <cstdio>
#include <string>

using namespace std;

int main()
{
  char s[100005];
  int len;
  char c;
  int b, w;
  int i;

  fgets(s, 100005, stdin);
  len = strlen(s) - 1;

#if 0
  printf("string is %s\n", s);
  printf("len %d\n", len);
#endif

  b = w = 0;
  c = s[0];
  if (c == 'B') b++;
  else if (c == 'W') w++;

  for (i=1; i<len; i++) {
    if (s[i] != c) {
      if (s[i] == 'B') {
        b++;
      } else {
        w++;
      }
      c = s[i];
    }
  }

#if 0
  printf("b=%d w=%d\n", b, w);
#endif

  if (b == 0 || w == 0) {
    printf("0\n");
    return 0;
  }
  if (b == 1 || w == 1) {
    printf("1\n");
    return 0;
  }
  if (w > b) {
    printf("%d\n", 2*b -1 );
  } else {
    printf("%d\n", 2*w -1 );
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'strlen' was not declared in this scope
   15 |   len = strlen(s) - 1;
      |         ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 |
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
int main() {
string s;
cin>>s;
ll f=0;
ll counter=0;
ll n=s.size();
if(s.at(0)=='W'){
f++;}
for(ll i=1; i<n; i++){
if((f==1&&s.at(i)=='W')||(f==0&&s.at(i)=='B') continue;
else{
counter++;
if(s.at(i)=='W'){
f=1;}
else
f=0;}}
cout<<counter<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:46: error: expected ';' before 'continue'
   17 | if((f==1&&s.at(i)=='W')||(f==0&&s.at(i)=='B') continue;
      |                                              ^~~~~~~~~
      |                                              ;
a.cc:18:1: error: expected primary-expression before 'else'
   18 | else{
      | ^~~~
a.cc:17:56: error: expected ')' before 'else'
   17 | if((f==1&&s.at(i)=='W')||(f==0&&s.at(i)=='B') continue;
      |   ~                                                    ^
      |                                                        )
   18 | else{
      | ~~~~                                                    
a.cc:23:6: error: expected primary-expression before '}' token
   23 | f=0;}}
      |      ^
Language: C++

#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <iostream>
#include <functional>
#include <bitset>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <numeric>
#define ll long long int
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int mx4[] = {0,1,0,-1};
int my4[] = {1,0,-1,0};
int INF = 2e6;
ll MOD = 1e9 + 7;

int main(){
    string s; cin >> s;
    int n = s.size();
a
    int ans = 0;
    for(int i = 0; i < n - 1; i++){
        if(s[i+1] != s[i]) ans++;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:1: error: 'a' was not declared in this scope
   29 | a
      | ^
a.cc:32:28: error: 'ans' was not declared in this scope; did you mean 'abs'?
   32 |         if(s[i+1] != s[i]) ans++;
      |                            ^~~
      |                            abs
a.cc:34:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   34 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(void)
{
  string s;cin >> s;
  int cnt=0;
  for(i=0;i<s.size()-1;i++){
    cnt+=(s[i]!=s[i+1])?1:0;
  }
  cout << cnt << endl;
}

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

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

Compiler output:
a.cc:1:21: warning: extra tokens at end of #include directive
    1 | #include <iostream> using namespace std;  int main() {     string s;     cin>>s;     int ans=0;     for(int i=1;i<s.size();i++)         if(s[i]!=s[i-1])             ans++;     cout<<ans<<endl;     return 0; }
      |                     ^~~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
void solve(){
    string s ;
    cin>>S; 
    int n = s.size();
    int ans =0;
    for(int i=1;i<n;i++){
        if(s[i]!=s[i-1])ans++;
    }
    cout<<ans<<endl;
}
int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int t=1;
//	cin>> t;
	while(t--)solve();
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:7:10: error: 'S' was not declared in this scope
    7 |     cin>>S;
      |          ^
Language: C++

//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main(){
  string s;cin>>s;
  ll ans=0;
  rep(i,s.size()-1){
    if(s[i+1]!=a[i])ans++;
  }
  cout<<ans<<endl;
}

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

#include<iostream>
#include<cstring>
#include<queue>
#include<algorithm>
#include<cstdio>
using namespace std;
int check(int x,int y){
	if(s[x]=='W'){
		if(s[y]=='B') return 1;
		else return 0;
	}
	if(s[x]=='B'){
		if(s[y]=='W') return 1;
		else return 0;
	}
}
int main(){
	char s[100005];
	scanf("%s",s);
	int n=strlen(s),ans=0;
	for(int i=0;i<n;i++){
		if(check(i,i+1)){
			ans++;
		}
	}
	printf("%d",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int check(int, int)':
a.cc:8:12: error: 's' was not declared in this scope
    8 |         if(s[x]=='W'){
      |            ^
a.cc:12:12: error: 's' was not declared in this scope
   12 |         if(s[x]=='B'){
      |            ^
a.cc:16:1: warning: control reaches end of non-void function [-Wreturn-type]
   16 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <string>
#include <cctype>
#include <cstdio>
#include <math.h>
using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
const int AMAX = 100000; 
using namespace std;
#define rep(i, n) for (i64 i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for (i64 i = m; i < n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define REVE(x) reverse(x.begin(), x.end())
#define all(x) (x).begin(), (x).end()
#define fst first
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pob pop_back
#define sw swap
#define UP(x) transform(x.begin(), x.end(), x.begin(), ::toupper);
#define down(x) transform(x.begin(), x.end(), x.begin(), ::tolower);
using LL = long long;
using ULL = unsigned long long;
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;
}

int main(void) {
    string a;
    cin >> a;
    LL ans;
    rep(i, a.size()-1){
　　 if(a[i]!=a[i+1])ans++
    }
    return 0;
}

Compiler output:
a.cc:69:1: error: extended character 　 is not valid in an identifier
   69 | 　　 if(a[i]!=a[i+1])ans++
      | ^
a.cc:69:1: error: extended character 　 is not valid in an identifier
a.cc:13:12: error: 'uint8_t' does not name a type
   13 | using u8 = uint8_t;
      |            ^~~~~~~
a.cc:12:1: note: 'uint8_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
   11 | #include <math.h>
  +++ |+#include <cstdint>
   12 | using i8 = int8_t;
a.cc:15:13: error: 'uint16_t' does not name a type
   15 | using u16 = uint16_t;
      |             ^~~~~~~~
a.cc:15:13: note: 'uint16_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:17:13: error: 'uint32_t' does not name a type
   17 | using u32 = uint32_t;
      |             ^~~~~~~~
a.cc:17:13: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:19:13: error: 'uint64_t' does not name a type
   19 | using u64 = uint64_t;
      |             ^~~~~~~~
a.cc:19:13: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc: In function 'int main()':
a.cc:69:1: error: '\U00003000\U00003000' was not declared in this scope
   69 | 　　 if(a[i]!=a[i+1])ans++
      | ^~~~
Language: C++

wwbww#include <iostream>
using namespace std;

int main(){
    string s;
    cin >> s;
    char latest = s[0];
    int acc = 0;
    for (int i=1;i<s.size();i++){
        if (s[i] != latest){
            acc += 1;
        }
        latest = s[i];
    }
    cout << acc << endl;
    return 0;
}

Compiler output:
a.cc:1:6: error: stray '#' in program
    1 | wwbww#include <iostream>
      |      ^
a.cc:1:1: error: 'wwbww' does not name a type
    1 | wwbww#include <iostream>
      | ^~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'string' was not declared in this scope
    5 |     string s;
      |     ^~~~~~
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> s;
      |     ^~~
a.cc:6:12: error: 's' was not declared in this scope
    6 |     cin >> s;
      |            ^
a.cc:15:5: error: 'cout' was not declared in this scope
   15 |     cout << acc << endl;
      |     ^~~~
a.cc:15:20: error: 'endl' was not declared in this scope
   15 |     cout << acc << endl;
      |                    ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

char ch[1000005];

int main()
{
    long int s=0,l=0,i,j;

    gets(ch);
    l=strlen(ch);

    for(i=1; i<l; i++){
        if (ch[i]!=ch[i-1]){
            ++s;
        }
    }
    printf("%ld\n",s);
    return 0;
}


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

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

int main(){
  string a;
  cin>>a;
  char b=a.at(0);
  int c=0;
  for(int i=0;i<a.aize();i++){
    if(a.at(i)!=b){
      b=a.at(i);
      c++;
    }
  }
  cout<<c<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'aize'; did you mean 'size'?
    9 |   for(int i=0;i<a.aize();i++){
      |                   ^~~~
      |                   size
Language: C++

#include<string.h>
int main()
{
int n,i,k;
char s[100005];
scanf("%s",&s);
k=strlen(s);
n=1;
for(i=0;i<k-1;i++)
{
if(s[i]!=s[i+1])
 n++;
}
printf("%d\n",n-1);
return 0;
}

Compiler output:
a.cc:12:1: error: extended character   is not valid in an identifier
   12 |  n++;
      | ^
a.cc: In function 'int main()':
a.cc:6:1: error: 'scanf' was not declared in this scope
    6 | scanf("%s",&s);
      | ^~~~~
a.cc:12:1: error: '\U000000a0n' was not declared in this scope
   12 |  n++;
      | ^~
a.cc:14:1: error: 'printf' was not declared in this scope
   14 | printf("%d\n",n-1);
      | ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    1 | #include<string.h>
  +++ |+#include <cstdio>
    2 | int main()