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

  #include<stido.h>
  #define N 10000
  int main(){
    int n,i,color[N],g;
    g=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&color[N]);
  }
  for(i=0;i<n-1;i++){
    if(color[i]==color[i+1]){
      color[i+1]==0;
      g++;
    }
  }
  printf("%d",g);
  return 0;
  
  }


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

#include<stdio.h>

int main()
{
    int i;
    int n;
    int s[100];

    int k = 0;

    scanf("%d", &n);

    for(i=0;i<n;i++){
        scanf("%d", &s[i]);
    }

    for(i=1;i<n;i++){
        if(s[i-1] == s[i]){
            k++;
            i++;
        }
    }

    print("%d\n", k);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:5: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   24 |     print("%d\n", k);
      |     ^~~~~
      |     printf
Language: C++

cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> T;

    REP(query, T) {
        cin >> A >> B >> C >> D;
        if(A < B || D < B) {
            cout << "No" << endl;
            continue;
        }
        if(C >= B) {
            cout << "Yes" << endl;
            continue;
        }
        lng g = gcd(D, B);
        A %= B;
        lng k = (B - A) / g;
        if((B-A)%g == 0) k--;
        if(A + k*g > C) {
            cout << "No" << endl;
        }
        else {
            cout << "Yes" << endl;
        }
    }

Compiler output:
a.cc:1:1: error: 'cin' does not name a type
    1 | cin.tie(0);
      | ^~~
a.cc:2:5: error: 'ios' does not name a type
    2 |     ios::sync_with_stdio(false);
      |     ^~~
a.cc:3:5: error: 'cin' does not name a type
    3 |     cin >> T;
      |     ^~~
a.cc:5:8: error: expected constructor, destructor, or type conversion before '(' token
    5 |     REP(query, T) {
      |        ^
Language: Java



import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class AGC026A {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        String input = sc.nextLine();
        System.out.println(execute(input));

    }

    public static int execute(String input) {

        List<String> list = Arrays.asList(input.split(" "));
        int sum = 0;

        for (int i = 0; i < list.size() - 1; i++) {
            if (list.get(i).equals(list.get(i + 1))) {
                i++;
                sum++;
            }
        }
        return sum;

    }
}


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

#include<iostream>

using namespace std;

int main(){
   int N,a[110],cnt=0;
   cin >>N;

   for(int i=1,i<=N;i++){
      cin>>a[i];
   }

   int bef = 0;


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

      if(a[i]==bef){
         cnt++;
         bef=a[i];
      }
   }
   cout<<cnt<<endl;
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: expected ';' before '<=' token
    9 |    for(int i=1,i<=N;i++){
      |                 ^~
      |                 ;
a.cc:9:17: error: expected primary-expression before '<=' token
    9 |    for(int i=1,i<=N;i++){
      |                 ^~
Language: C++

//AcFreak

#include<bits/stdc++.h>
#define lint long long int 
#define mp make_pair
#define pb push_back
#define f first
#define INF (lint )(1e9)
#define __ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define s second
#define endl '\n'
#define pii pair<int,int >
using namespace std;


int main()
{__
      
      int n;
      cin>>n;
      vector<int >arr(n);

      int i,j;
      for(i=0;i<n;i++)
      	ciin>>arr[i];

      int cc=0;
      for(i=0;i<n-1;i++)
      {
      	if(arr[i]==arr[i+1])
      	{
      		arr[i+1]=0;
      		cc++;
      	}
      	else
      		continue;
      }
      cout<<cc<<endl;
      return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'ciin' was not declared in this scope
   25 |         ciin>>arr[i];
      |         ^~~~
Language: C++

#include "bits/stdc++.h"
using namespace std;
int main(){
    int n;
    cin >> n;
    int a, before = 0; // 
    int cnt = 1, ans = 0;
    for(int i = 0 ; i < n ; i++){
        cin >> a;
        if(before == a) cnt++;　// 連続数をカウント
        else{
            before = a;
            ans += cnt / 2; // 違ったらカウントした分を反映
            cnt = 1;
        }
    }
    ans += cnt / 2; // 最後の反映されてない部分を反映
    cout << ans;
}

Compiler output:
a.cc:10:31: error: extended character 　 is not valid in an identifier
   10 |         if(before == a) cnt++;　// 連続数をカウント
      |                               ^
a.cc: In function 'int main()':
a.cc:10:31: error: '\U00003000' was not declared in this scope
   10 |         if(before == a) cnt++;　// 連続数をカウント
      |                               ^~
Language: C++

#include <bits/stdc++.h>
using namespace std 
int main(){
int n,k[100],count=0;
  cin>>n;
  for(int i=0;i<n;++i){
   cin>>k[i];
  }
  for(int i=1;i<=n;++i){
   if(k[i-1]==k[i]){
     ++count;
     k[i]=10000;
   }
  }
  cout<<count<<endl;
}


Compiler output:
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | int main(){
      | ~~~
Language: C++

#include <bits/stdc++.h>
using namespace std 
int main(){
int,n,k[100],count=0;
  cin>>n;
  for(int i=0;i<n;++i){
   cin>>k[i];
  }
  for(int i=1;i<=n;++i){
   if(k[i-1]==k[i]){
     ++count;
     k[i]=10000;
   }
  }
  cout<<count<<endl;
}

Compiler output:
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | int main(){
      | ~~~                 
a.cc: In function 'int main()':
a.cc:4:4: error: expected unqualified-id before ',' token
    4 | int,n,k[100],count=0;
      |    ^
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[] al = new int[N];
      	int comp = 10001;
      	int double_times = 0;
      	int need_to_change = 0;
      	for(int i=0;i<N,i++){
          color = sc.nextInt();
          if(color == comp){
            double_times++;
          }else{
            need_to_change += double_times/2;
            double_times = 0;
          }
          comp = color;
          
        }

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

Compiler output:
Main.java:12: error: ';' expected
      	for(int i=0;i<N,i++){
      	               ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;cin>>n;
  vector<int> v(n);
  for(int i=0;i<n;i++)
  {
    cin>>v[i];
  }
  int i=1;
  if(n==2)
  {
    if(v[0]==v[1]) cout<<1<<endl;
    else cout<<0<<endl;
    return 0
  }
  int count=0;
  while(i<n)
  { 
    if(v[i]==v[i-1])
      { count++;i=i+2;}
    else if((i+1<n) && v[i]==v[i+1])
      {count++;i=i+3;}
    else ;
   }
   cout<<count<<endl;
    return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: expected ';' before '}' token
   16 |     return 0
      |             ^
      |             ;
   17 |   }
      |   ~
Language: C++

include <iostream>
using namespace std;

int main()
{
  int N;
  int count=0;
  cin >> N;
  int s[N];
  for(int i=0;i<N;++i)
  {
    cin >> s[i];
  }
  for(int i=1;i<N;i++)
  {
    if (s[i]==s[i-1])
    {
      if(s[i] == s[i+1])
      {
        i++;
      }
      count++;
    }
  }
  cout << count << endl;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> N;
      |   ^~~
a.cc:25:3: error: 'cout' was not declared in this scope; did you mean 'count'?
   25 |   cout << count << endl;
      |   ^~~~
      |   count
a.cc:25:20: error: 'endl' was not declared in this scope
   25 |   cout << count << endl;
      |                    ^~~~
Language: C++

#include<bits\stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int f[n];
for(int i=0;i<n;i++) cin>>f[i];
int j=0;
for(int i=1;i<n;i++)
if(f[i]==f[i-1])
{
j++;
f[i]=n+3i;
}
cout<<j;
}


Compiler output:
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
    1 | #include<bits\stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss


Compiler output:
a.cc:1:1: error: 'ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss' does not name a type
    1 | ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: invalid types 'int[int]' for array subscript
    8 |   cin >> n[i];
      |           ^
a.cc:9:15: error: invalid types 'int[int]' for array subscript
    9 |   if(i!=0 && n[i-1]==n[i]){
      |               ^
a.cc:9:23: error: invalid types 'int[int]' for array subscript
    9 |   if(i!=0 && n[i-1]==n[i]){
      |                       ^
a.cc:10:5: error: invalid types 'int[int]' for array subscript
   10 |    n[i]=0;
      |     ^
Language: C++

#include "stdafx.h"


#include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
#include<map>
#include<numeric>
//#include <bits/stdc++.h>
#include<cstring>
#include<iostream>
#include<functional>
using namespace std;
typedef long long ll;

int main() {

	int N;
	cin >> N;
	vector<long> a(N);
	for (int i = 0; i < N; i++)
		cin >> a[i];
	int ans = 0;
	for (int i = 0; i < N-1; i++) {
		if (a[i] == a[i + 1]) {
			ans++;
			a[i + 1] = -1;
		}
	}
	cout << ans << endl;
	//cin >> N;



	return 0;
}


Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;

public class Main {

	public static void main(String[] args){
	
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		List<Integer> a = new ArrayList<>();
		
		while(sc.hasNextInt()){
			a.add(sc.nextInt());
		}
		
		int x = 0;
		
		for(int i = 0; i < n-2; i+=2){
			
			int a_nm = a.get(i);
			int a_n = a.get(i+1);
			int a_np = a.get(i+2);
			
			if(a_nm==a_n && a_n==a_np){
				x++;
			}
			else if(a_nm==a_n){
				x++;
			}
          else if(a_n==a_np){
           		Ai++;
				x++;
			}
		}
      
      	if(a.get(n-2)==a.get(n-1)&&n%2==0){
        	x++;
        }
      
		System.out.print(x);	
	}
}




Compiler output:
Main.java:31: error: cannot find symbol
           		Ai++;
           		^
  symbol:   variable Ai
  location: class Main
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int N;
	cin>>N;
	int a[N];
	for(int i=0;i<N;i++)
	{
		cin>>a[i];
	}
	int ans=0;
	for(int i=0;i<N;i++)
	{
		if(s[i]==s[i+1])
		{
			ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
 } 

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

#include <iostream>
#include <cstdio>
using namespace std;
int main() {
    int number;
	scanf("%d",&number)
    int slime[100];
    for(int i=0;i < number; i++){
       scanf("%d",&slime[number]);
    }
    int magic = 0;
    for(int i=1;i < number-1; i++){
        if(slime[i]==slime[i+1]){
            magic++; 
        }
    }
    printf("%d",magic);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:28: error: expected ';' before 'int'
    6 |         scanf("%d",&number)
      |                            ^
      |                            ;
    7 |     int slime[100];
      |     ~~~                     
a.cc:9:20: error: 'slime' was not declared in this scope
    9 |        scanf("%d",&slime[number]);
      |                    ^~~~~
a.cc:13:12: error: 'slime' was not declared in this scope
   13 |         if(slime[i]==slime[i+1]){
      |            ^~~~~
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;
int main() {
    int number;
	scanf("%d",&number)
    int slime[number];
    for(int i=0;i < number; i++){
       scanf("%d",&slime[number]);
    }
    int magic = 0;
    for(int i=1;i < number-1; i++){
        if(slime[i]==slime[i+1]){
            magic++; 
        }
    }
    printf("%d",&magic);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:28: error: expected ';' before 'int'
    6 |         scanf("%d",&number)
      |                            ^
      |                            ;
    7 |     int slime[number];
      |     ~~~                     
a.cc:9:20: error: 'slime' was not declared in this scope
    9 |        scanf("%d",&slime[number]);
      |                    ^~~~~
a.cc:13:12: error: 'slime' was not declared in this scope
   13 |         if(slime[i]==slime[i+1]){
      |            ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define il inline
#define ll long long
#define outy printf("Yes\n")
#define outn printf("No\n")
#define outf printf("First\n")
#define outs printf("Second\n")
#define FOR(a,b,c) for(int a=b;a<=c;a++)
#define FORD(a,b,c) for(int a=b;a>=c;a--)
#define FORL(a,b) for(int a=head[b];a;a=nxt[a])
#define in(a)  a=read()
#define in2(a,b)  in(a),in(b)
#define in3(a,b,c)  in2(a,b),in(c)
#define in4(a,b,c,d)  in2(a,b),in2(c,d)
#define out(a) printf("%d\n",a)
#define out2(a,b) printf("%d %d\n",a,b)
#define out3(a,b,c) printf("%d %d %d\n",a,b,c)
#define out4(a,b,c,d) printf("%d %d %d %d\n",a,b,c,d)
#define outl(a) printf("%lld\n",a)
#define outl2(a,b) printf("%lld %lld\n",a,b)
#define outl3(a,b,c) printf("%lld %lld %lld\n",a,b,c)
#define outl4(a,b,c,d) printf("%lld %lld %lld %lld\n",a,b,c,d)
#define clr(x,y) memset(x,y,sizeof(x))
unsigned ll read(){
    unsigned ll f=1,x=0;char c=getchar();
    while(c>'9'||c<'0'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9')x=x*10+c-'0',c=getchar();
    return x*f;
}
/*------------------------------------------------------------*/
#define mod 1000000007
#define maxn 100010
#define inf 0x7fffffff
/*------------------------------------------------------------*/
int n,m;
//int a[maxn];
int main(){
	int t;
	in(t);
	while(t--){
		unsigned ll a,b,c,d;
		in4(a,b,c,d);
		if(a<b){outn;continue;}
		a=(a-(a-c)/b*b);
		if(a<=c)a+=d;
		if(a<b){outn;continue;}
		if(d<b){outn;continue;}
		FOR(i,1,190817){
			if(a<=c)a+=d;
			if(a<b){outn;f=1;break;}
			 else a-=b;
		}
		if(!f)outy;
	}
//	(c-(a-(a-c)/b*b)+d)/(d-b)
//	a-b+((c-a)/(d-b)+1)*(d-b)
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:38: error: 'f' was not declared in this scope
   51 |                         if(a<b){outn;f=1;break;}
      |                                      ^
a.cc:54:21: error: 'f' was not declared in this scope
   54 |                 if(!f)outy;
      |                     ^
Language: C++

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

int main() {
  int N,i,b=0,c=0;
  int a[100];
  cin >> N;
  for(i=0;i!=N;i++{
    cin >> a[i];
    if(a[i]==a[i-1]){
      b++;
    }
    else{
      b=b/2;
      c=c+b;
      b=0;
    }
  }
  cout << c << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: expected ')' before '{' token
    8 |   for(i=0;i!=N;i++{
      |      ~            ^
      |                   )
Language: C++

#include<iostrea>
using namespace std;
int main(){
 int n,s=0,x,y;
  cin>>n>>x;
  for(int i=1;i<n;i++){
    cin>>y;
    if(y==x)s++,y=-1;
    x=y;}cout<<s<<endl;}

Compiler output:
a.cc:1:9: fatal error: iostrea: No such file or directory
    1 | #include<iostrea>
      |         ^~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		List<Integer> list = new ArrayList<>();
		// スペース区切りの整数の入力
		for(int i=1;i<=a;i++){
			list.add(sc.nextInt());
		}

		int count =0;
		for(int j=0;j<a;j++){
// System.out.println("j"+j);

			if(j==a-1){
				if(value==list.get(j-1)){
					count++;
				}
			}
			else if(j!=0){
							int value = list.get(j);
			if(value==list.get(j-1)){
				if(value==list.get(j+1)){
					

					if(list.get(j+1)==value+1){
						list.set(j,j-1);
					}else{
						list.set(j,j+1);
					}

					count++;
				}else{
					if(list.get(j+1)==value+1){
						list.set(j,j-1);
					}else
					{
						list.set(j,j+1);
					}
					count++;
				}
			}

				
							}
							// System.out.println("count"+count);
		}
		// System.out.println(list);
		System.out.println(count);
	}
}

Compiler output:
Main.java:18: error: cannot find symbol
				if(value==list.get(j-1)){
				   ^
  symbol:   variable value
  location: class Main
1 error
Language: C++

#include <iostream>

int main()
{
  int N;
  std::cin >> N;
  std::string A;
  std::cin >> A;
 
  int result = 0;
  for (int i = 1; i < A.size(); i++) {
    if (A[i] == A[i - 1]) {
      result +=1;
      i += 1;
    }
  }
  std::cout << result << endl;
  
  return 1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   17 |   std::cout << result << endl;
      |                          ^~~~
      |                          std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main('){
int n; cin>>n;
for(int i=0;i<n;++i){
int a,b,c,d;
cin>>a>>b>>c>>d;
int tmp=b;
while(b>=a) b-=a;
if(c+d>=tmp*2) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
}

Compiler output:
a.cc:3:10: warning: missing terminating ' character
    3 | int main('){
      |          ^
a.cc:3:10: error: missing terminating ' character
    3 | int main('){
      |          ^~~
a.cc:4:6: error: expected ')' before ';' token
    4 | int n; cin>>n;
      |      ^
      |      )
a.cc:3:9: note: to match this '('
    3 | int main('){
      |         ^
a.cc:3:5: warning: 'int main(int)' takes only zero or two arguments [-Wmain]
    3 | int main('){
      |     ^~~~
a.cc:4:8: error: 'cin' does not name a type
    4 | int n; cin>>n;
      |        ^~~
a.cc:5:1: error: expected unqualified-id before 'for'
    5 | for(int i=0;i<n;++i){
      | ^~~
a.cc:5:13: error: 'i' does not name a type
    5 | for(int i=0;i<n;++i){
      |             ^
a.cc:5:17: error: expected unqualified-id before '++' token
    5 | for(int i=0;i<n;++i){
      |                 ^~
a.cc:13:1: error: expected unqualified-id before 'return'
   13 | return 0;
      | ^~~~~~
a.cc:14:1: error: expected declaration before '}' token
   14 | }
      | ^
Language: C++

using namespace std;

int main(){
    int n,a[100],x;
    cin>>n;
    for(int i=1;i<=n;i++)cin>>a[i];
    for(int i=3;i<=n;i++){
        if(a[i-2]==a[i-1]){
            a[i-1]=a[i-2]+a[i];
            x++;
        }
    

    }
  cout<<x<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     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 | using namespace std;
a.cc:15:3: error: 'cout' was not declared in this scope
   15 |   cout<<x<<endl;
      |   ^~~~
a.cc:15:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:12: error: 'endl' was not declared in this scope
   15 |   cout<<x<<endl;
      |            ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: Java

public class Main {
	public static int N = 0;
	public static int count = 0;
	
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		N = scan.nextInt();
		int a[] = new int[N];
		
		for(int i = 0;i < N;i++) {
			a[i] = scan.nextInt();
		}
	
		for(int i=1;i < a.length-1;i++) {
			if(a[i] == a[i-1] || a[i] == a[i+1]) {
				count++;
				if(a[i] == a[i+1]) {
					i++;
				}
			}
		}
		scan.close();
		System.out.println(count);
	}
}

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

#include <iostream>

int n, a[100], count, count1, count2,  count3;
int main()
{
	std::cin >> n;
	for(int i = 0; i < n; i++)
	{
		std::cin >> a[i];

	}
	for(int i = 0; i < n; i++)
	{
		if(a[i] == a[i+1])
		{
			count2++;
			if(a[i] == a[i+2])
			{
				count1++;
				i += 2;
			}else
			{
				count++;
			}
			
		}
	}
	if(count2 == n-1)
	{
		if(n <= 1)
		{
			std::cout << 0;
		}else
		{
			std::cout << count2 - 2;
		}
	}else
	{
		std::cout << count + count1; 
	

Compiler output:
a.cc: In function 'int main()':
a.cc:39:45: error: expected '}' at end of input
   39 |                 std::cout << count + count1;
      |                                             ^
a.cc:38:9: note: to match this '{'
   38 |         {
      |         ^
a.cc:39:45: error: expected '}' at end of input
   39 |                 std::cout << count + count1;
      |                                             ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C

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


int *alloc_vector(int n) {
  int *vec;
  vec = (int*)malloc((size_t)(n * sizeof(int)));
  if (vec == NULL) {
    fprintf(stderr, "Error: allocation failed in alloc_ivector\n");
    exit(1);
  }
  return vec;
}
int main()
{
    int count = 0;
    int N;
    scanf("%d",&N);
    int *a;
    a = alloc_vector(N);
    for(int i=0;i<N;++i){
        scanf("%d", &a[i]);
    }
    
    for(int i=0;i<N-2;i++){
      if(a[i]==a[i+1]){
        if(a[i] > N-2){
          if(a[i+2]==(a[i+1]-1)){
          a[i+1] -= 2;
          }else{
          a[i+1] -= 1;
        }
        }
        if(a[i+2]==(a[i+1]+1)){
          a[i+1] += 2;
        }else{
          a[i+1] += 1;
        }
        count++;
      }
    }
    if(N==2){
      if(a[0]==a[1]){
        count++:
      }
    }

    

    printf("%d",count);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:44:16: error: expected ';' before ':' token
   44 |         count++:
      |                ^
      |                ;
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// スライムの数の入力
		int n = sc.nextInt();
		
		// 並んでいるスライムの入力
		while(i =! n + 1){
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
				if(b == c){
					k = k + 1;
					
				}
			
			n = n + 1;
		}
		
		
		// 出力
		System.out.println(k);
	}
}

Compiler output:
Main.java:10: error: cannot find symbol
		while(i =! n + 1){
		      ^
  symbol:   variable i
  location: class Main
Main.java:10: error: bad operand type int for unary operator '!'
		while(i =! n + 1){
		         ^
Main.java:15: error: cannot find symbol
					k = k + 1;
					^
  symbol:   variable k
  location: class Main
Main.java:15: error: cannot find symbol
					k = k + 1;
					    ^
  symbol:   variable k
  location: class Main
Main.java:24: error: cannot find symbol
		System.out.println(k);
		                   ^
  symbol:   variable k
  location: class Main
5 errors
Language: Java

N = int(input())
a = list(map(int, input().split()))
cnt = 0

left = a[0]

for i in range(1,N):
    if  a[i] == left:
        a[i] += 1
        if not i == N and a[i] == a[i + 1]:
            a[i] += 1
        cnt += 1
    left = a[i]

print(cnt)

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
N = int(input())
^
1 error
Language: C

include <stdio.h>

main(){
    int N;
    int i,a[100];
    int rt=0;

    scanf("%d",&N);
    for(i=0;i<N;i++)
        scanf("%d",&a[i]);

    for(i=1;i<N;i++){
        if(a[i]==a[i-1]){
            rt++;
            i++;
        }
    }
    printf("%d\n",rt);
    return 0;
}


Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  cin >> N;
  vector<int> a(N);
  for(int i=0;i<N;i++){
    cin >> a.at(i);}
  for(int i=0;i<N-1;i++){
    if(a.at(i)==a.at(i+1)){
      b++;
      i++;
    }
  }
  cout << b << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'b' was not declared in this scope
   12 |       b++;
      |       ^
a.cc:16:11: error: 'b' was not declared in this scope
   16 |   cout << b << endl;
      |           ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  int<vector> a(N);
  for(int i=0;i<N;i++){
    cin >> a.at(i);}
  for(int i=0;i<N-1;i++){
    if(a.at(i)==a.at(i+1)){
      b++;
      i++;
    }
  }
  cout << b << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'int' is not a template
    7 |   int<vector> a(N);
      |   ^~~
a.cc:9:14: error: request for member 'at' in 'a', which is of non-class type 'int'
    9 |     cin >> a.at(i);}
      |              ^~
a.cc:11:10: error: request for member 'at' in 'a', which is of non-class type 'int'
   11 |     if(a.at(i)==a.at(i+1)){
      |          ^~
a.cc:11:19: error: request for member 'at' in 'a', which is of non-class type 'int'
   11 |     if(a.at(i)==a.at(i+1)){
      |                   ^~
a.cc:12:7: error: 'b' was not declared in this scope
   12 |       b++;
      |       ^
a.cc:16:11: error: 'b' was not declared in this scope
   16 |   cout << b << endl;
      |           ^
Language: C++

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

int main(){
int N;
cin>>N;
int a[N];
int b[N+1];
b[0]=-1;
int s=1
for(int i=0;i<=N;i++){
    if(a[i]!=a[i+1]){
        b[s]=i;
        s++;
    }
}
b[s]=N-1;
int p=0;
for(int j=0;j<s;j++){
    p=p+floor((b[j+1]-b[j])/2);
}
cout<<p<<endl;
}
    

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

#include <string>
using namespace std;
 
int main() {
    unsigned long long n,a[100],x=0;
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    for(int i=0;i<n;i++){
        if(a[i]==a[i+1]){
            x++;
            i++;
        }
    }
    cout << x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> n;
      |     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:16:5: error: 'cout' was not declared in this scope
   16 |     cout << x << endl;
      |     ^~~~
a.cc:16:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:18: error: 'endl' was not declared in this scope
   16 |     cout << x << endl;
      |                  ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <string>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

#include<bits/stdc++.h>
using namespace std ;
int main(){
    int a[110] ;
    int n ;
    cin >> n ;
    for( int i = 1 ; i <= n ; i++ )
        cin >> a[i] ;
    int ans = 0 ;
    int cnt = 0 ;
    for( int i = 1 ; i <= n ; i++ ){
        if ( a[i] == a[i - 1] ) cnt++ ;
        else cnt = 1 ;
        if ( i == n || a[i] != a[i + 1] ) ans += cnt / 2 ;
    }
    cout << ans << endl ;
    return 0 ;
}#include<bits/stdc++.h>
using namespace std ;
int main(){
    int a[110] ;
    int n ;
    cin >> n ;
    for( int i = 1 ; i <= n ; i++ )
        cin >> a[i] ;
    int ans = 0 ;
    int cnt = 0 ;
    for( int i = 1 ; i <= n ; i++ ){
        if ( a[i] == a[i - 1] ) cnt++ ;
        else cnt = 1 ;
        if ( i == n || a[i] != a[i + 1] ) ans += cnt / 2 ;
    }
    cout << ans << endl ;
    return 0 ;
}

Compiler output:
a.cc:18:2: error: stray '#' in program
   18 | }#include<bits/stdc++.h>
      |  ^
a.cc:18:3: error: 'include' does not name a type
   18 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:20:5: error: redefinition of 'int main()'
   20 | int main(){
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main(){
      |     ^~~~
Language: Java

public class Main {

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

		int N = sc.nextInt();

		int before = 0;
		int result = 0;
		boolean isSame = false;
		for (int i = 0; i < N; i++) {
			int cu = sc.nextInt();
			if (0 == i) {
				before = cu;
				continue;
			}

			if (isSame) {
				isSame = false;
				before = cu;
				continue;
			}

			if (before == cu) {
				isSame = true;
				result++;
			}
			before = cu;
		}
		System.out.println(result);
	}
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
 int n; cin>>n;
int cnt=0;
int a[n];
for(int i=0;i<n;++i) cin>>a[i];
for(int i=0;i<n;++i){
if(i){
 if(a[i]==a[i-1] && a[i-1]!=-1){ ++cnt; a[i]=-1;
}
}
cout<<cnt<<endl;
return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
 int n; cin>>n;
int cnt=0;
int a[n];
for(int i=0;i<n;++i) cin>>a[i];
for(int i=0;i<n;++i){
if(i){
 if(a[i]==a[i-1] && a[i-1]!=-1){ ++cnt; a[i]=-1;
}
}
cout<<cnt<<endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: expected '}' at end of input
   13 | cout<<cnt<<endl;
      |                 ^
a.cc:8:21: note: to match this '{'
    8 | for(int i=0;i<n;++i){
      |                     ^
a.cc:13:17: error: expected '}' at end of input
   13 | cout<<cnt<<endl;
      |                 ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

int main(){
    int n;
    cin>>n;
    int p=-1, l=0, ans=0;
    for(int i=0; i<n; i++){
        int a;
        cin>>a;
        if(a==p) l++;
        else{
            ans+=l/2;
            p=a;
            l=1;
        }
    }
    ans+=l/2;
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin>>n;
      |     ^~~
a.cc:19:5: error: 'cout' was not declared in this scope
   19 |     cout<<ans<<endl;
      |     ^~~~
a.cc:19:16: error: 'endl' was not declared in this scope
   19 |     cout<<ans<<endl;
      |                ^~~~
Language: C++

#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
#define nl '\n'
#define sp ' '
#define a_m a,b,c,d,e,f,g,h,i,j,k,l,m
#define n_z n,o,p,q,r,s,t,u,v,w,x,y,z
#define ri(b,c) for(ll i=(b);i<(c);++i)
#define rj(b,c) for(ll j=(b);j<(c);++j)
#define rk(b,c) for(ll k=(b);k<(c);++k)
#define rl(b,c) for(ll l=(b);l<(c);++l)
#define rr(b,c) for(ll r=(b);r>(c);--r)
#define f10(a) cout<<fixed<<setprecision(10)<<a
#define f0(a,b) cout<<setfill('0')<<setw(a)<<right<<b
#define hasten cin.tie(0);ios::sync_with_stdio(false)
const int prime[15]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47};

inline void ln(){cout<<nl;}
template<class T,class...A>
inline void ln(const T& first,const A&...rest)
{cout<<first;ln(rest...);}
template<class...A>inline void ln(const A&...rest)
{ln(rest...);}

template <class T>inline void so(T t){cout<<t<<nl;}
template <class T, class...A>
inline void so(T first,A...rest)
{cout<<first<<' ';so(move(rest)...);}

inline void op(){}
template<class T,class...A>
inline void op(const T& first,const A&...rest)
{cout<<first;op(rest...);}

inline void in(){}
template<class T,class...A>
inline void in(T&& first,A&&...rest)
{cin>>first;in(move(rest)...);}

//GCD is declared in C++17 and after
inline ll gcd(ll a,ll b)
{ll c;while(a){c=a;a=b%a;b=c;}return b;}
inline bool isp(ll a){
	if(a<48){ri(0,15)if(prime[i]==a)return 1;}
	else if(a<2809)return gcd(614889782588491410,a)==1;
	else ln("Error");return 0;
}

int main(){
	hasten;
	ll a_m,n_z;
	in(a);
    p=0;
    array <ll>sl[10000];
    ri(0,a){
        in(b);
        sl[b-1]++;
    }
    ri(0,10000)p+=sl[i]/2;







	ln(p);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:14: error: wrong number of template arguments (1, should be 2)
   54 |     array <ll>sl[10000];
      |              ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 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_pair.h:99:12: note: provided for 'template<class _Tp, long unsigned int _Nm> struct std::array'
   99 |     struct array;
      |            ^~~~~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class ProblemA {
    BufferedReader rd;

    ProblemA() throws IOException {
        rd = new BufferedReader(new InputStreamReader(System.in));
        compute();
    }

    private void compute() throws IOException {
        rd.readLine();
        int[] a = intarr();
        int res = 0;

        int last = -1;
        int start = 0;
        for(int i=0;i<a.length;i++) {
            if(a[i] != last) {
                res += (i - start) / 2;
                start = i;
            }
            last = a[i];
        }
        res += (a.length - start) / 2;
        out(res);
    }

    private int[] intarr() throws IOException {
        return intarr(rd.readLine());
    }

    private int[] intarr(String s) {
        String[] q = split(s);
        int n = q.length;
        int[] a = new int[n];
        for(int i=0;i<n;i++) {
            a[i] = Integer.parseInt(q[i]);
        }
        return a;
    }

    private String[] split(String s) {
        if(s == null) {
            return new String[0];
        }
        int n = s.length();
        int start = -1;
        int end = 0;
        int sp = 0;
        boolean lastWhitespace = true;
        for(int i=0;i<n;i++) {
            char c = s.charAt(i);
            if(isWhitespace(c)) {
                lastWhitespace = true;
            } else {
                if(lastWhitespace) {
                    sp++;
                }
                if(start == -1) {
                    start = i;
                }
                end = i;
                lastWhitespace = false;
            }
        }
        if(start == -1) {
            return new String[0];
        }
        String[] res = new String[sp];
        int last = start;
        int x = 0;
        lastWhitespace = true;
        for(int i=start;i<=end;i++) {
            char c = s.charAt(i);
            boolean w = isWhitespace(c);
            if(w && !lastWhitespace) {
                res[x++] = s.substring(last,i);
            } else if(!w && lastWhitespace) {
                last = i;
            }
            lastWhitespace = w;
        }
        res[x] = s.substring(last,end+1);
        return res;
    }

    private boolean isWhitespace(char c) {
        return c==' ' || c=='\t';
    }

    private static void out(Object x) {
        System.out.println(x);
    }

    public static void main(String[] args) throws IOException {
        new ProblemA();
    }
}


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

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
    int n,a,f,answer=0;
    cin>>n>>f;
    for(int i=1;i<n;i++){
        if(f==a){
            count++;
            i++;
        }
    }
count<<count;
    /* code */
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:10:18: error: no post-increment operator for type
   10 |             count++;
      |                  ^~
a.cc:14:6: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator<<'
   14 | count<<count;
      | ~~~~~^~~~~~~
Language: C++

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>

#define maxn 10005

using namespace std;

inline int getint()
{
	int num=0,falg=1;char c;
	while((c=getchar())<48||c>57)if(c=='-')flag=-1;
	while(c>=48&&c<=57)num=num*10+c-48,c=getchar();
	return num*flag;
}

int n,ans;
int a[maxn];

int main()
{
	n=getint();
	for(int i=1;i<=n;i++)
	{
		a[i]=getint();
		if(a[i]==a[i-1])a[i]=10001,ans++;
	}
	printf("%d\n",ans);
}

Compiler output:
a.cc: In function 'int getint()':
a.cc:13:48: error: 'flag' was not declared in this scope; did you mean 'falg'?
   13 |         while((c=getchar())<48||c>57)if(c=='-')flag=-1;
      |                                                ^~~~
      |                                                falg
a.cc:15:20: error: 'flag' was not declared in this scope; did you mean 'falg'?
   15 |         return num*flag;
      |                    ^~~~
      |                    falg
Language: C++

#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
#define nl '\n'
#define sp ' '
#define a_m a,b,c,d,e,f,g,h,i,j,k,l,m
#define n_z n,o,p,q,r,s,t,u,v,w,x,y,z
#define ri(b,c) for(ll i=(b);i<(c);++i)
#define rj(b,c) for(ll j=(b);j<(c);++j)
#define rk(b,c) for(ll k=(b);k<(c);++k)
#define rl(b,c) for(ll l=(b);l<(c);++l)
#define rr(b,c) for(ll r=(b);r>(c);--r)
#define f10(a) cout<<fixed<<setprecision(10)<<a
#define f0(a,b) cout<<setfill('0')<<setw(a)<<right<<b
#define hasten cin.tie(0);ios::sync_with_stdio(false)
const int prime[15]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47};

inline void ln(){cout<<nl;}
template<class T,class...A>
inline void ln(const T& first,const A&...rest)
{cout<<first;ln(rest...);}
template<class...A>inline void ln(const A&...rest)
{ln(rest...);}

template <class T>inline void so(T t){cout<<t<<nl;}
template <class T, class...A>
inline void so(T first,A...rest)
{cout<<first<<' ';so(move(rest)...);}

inline void op(){}
template<class T,class...A>
inline void op(const T& first,const A&...rest)
{cout<<first;op(rest...);}

inline void in(){}
template<class T,class...A>
inline void in(T&& first,A&&...rest)
{cin>>first;in(move(rest)...);}

//GCD is declared in C++17 and after
inline ll gcd(ll a,ll b)
{ll c;while(a){c=a;a=b%a;b=c;}return b;}
inline bool isp(ll a){
	if(a<48){ri(0,15)if(prime[i]==a)return 1;}
	else if(a<2809)return gcd(614889782588491410,a)==1;
	else ln("Error");return 0;
}

int main(){
	hasten;
	ll a_m,n_z;
	in(a);
    p=0;
    ll sl[a];
    ri(0,a){
        in(b);
        if(b-sl[p]){
            sl[++p]=b;
        }
    }







	ln(sl.size());
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:15: error: request for member 'size' in 'sl', which is of non-class type 'll [a]' {aka 'long long int [a]'}
   68 |         ln(sl.size());
      |               ^~~~
Language: C++

#include <iostream>

using namespace std;

int n;
int a[105];

int main(void)
{
	cin >> n;
	for(int i = 0; i < n; i++) cin >> a[i];
	
	int ans = 0;
	bool flag = false;
	for(int i = 1; i < n; i++){
		if(!flag){
			if(a[i] == a[i-1]){
				ans++;
				flag = true;
			}
		}else flag = false;
	}
	cout << ans << endl;
	return 0;a
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: expected ';' before '}' token
   24 |         return 0;a
      |                   ^
      |                   ;
   25 | }
      | ~
Language: C++

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

#define int long long

signed main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for(int i=0; i<n; ++i) cin >> v[i];
  int ans = 0;
  for(int i=0; i<n-1; ++i) {
    if(v[i]==v[i+1]) {
      ans++;
      i+;
    }
  }
  cout << ans << endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: expected primary-expression before ';' token
   15 |       i+;
      |         ^
Language: C++

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

#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef complex<double> point;
#define xx real()
#define yy imag()

#define REP(i, a, b) for(int i = (a); i < (int)(b); i++)
#define REPN(i, a, b) for(int i = (a); i <= (int)(b); i++)
#define FA(it, x) for(__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define SZ(x) (int)(x).size()
#define BE(x) (x).begin(), (x).end()
#define SORT(x) sort(BE(x))
#define _1 first
#define _2 second

#define x1 gray_cat_x1
#define y1 gray_cat_y1

template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }

#define file "I1"

const double EPS = 1e-9;
const double PI = acos(-1.);
const int INF = 1e9;
const ll MOD = 1e9 + 7;

const int MAXN = 1e5 + 5;

int v[MAXN];

void solve(){
	int n;
	int ans = 0;
	scanf("%d%d", &n, &v[0]);
	REP(i, 1, n){
		scanf("%d", &v[i]);
		if (v[i] == v[i - 1]){
			v[i] = -1;
			ans++;
		}
	}
	printf("%d\n", ans);
}   

int main(){
if
    //freopen(file".in", "r", stdin); freopen(file".out", "w", stdout);
    int t = 1;
    //cin >> t;
    while(t--){
        solve();    
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:5: error: expected '(' before 'int'
   55 |     int t = 1;
      |     ^~~
      |     (
a.cc:57:11: error: 't' was not declared in this scope
   57 |     while(t--){
      |           ^
Language: C++

#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
	int t;
	ll a, b, c, d;
	bool  ans=true;
	cin >>t;
	set<ll> dis;
	rep(i, t) { cin >> a >> b >> c >> d;
		dis.clear();
		a = max(-1LL, a-((a - c + b-1) / b)*b);
		clog << a << endl;
		dis.insert(a);
		if (a == -1) {
			cout << solve(0) << endl;
			continue;
		}
		while(a>-1) {
			a += c;
			a = max(-1LL, a - ((a - c + b - 1) / b) * b);
			if (a == -1) {
				cout << solve(0) << endl;
			}
			if (dis.contains(a)) {
				cout << solve(1) << endl;
				break;
			}
			dis.insert(a);
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:33: error: 'class std::set<long long int>' has no member named 'contains'
   49 |                         if (dis.contains(a)) {
      |                                 ^~~~~~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
	int T;
	cin >> T;
	for (int i = 0; i < T; i++){
		long long A, B, C, D;
		cin >> A >> B >> C >> D;
		if (A < B){
			cout << "No" << endl;
		} else if (B > D){
			cout << "No" << endl;
		} else if (B < C){
			cout << "Yes" << endl;
		} else if (B - C <= gcd(B, D)){
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:37: error: 'gcd' was not declared in this scope
   15 |                 } else if (B - C <= gcd(B, D)){
      |                                     ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
ll gcd(ll x, ll y) { return (x % y)? gcd(y, x % y): y; }    //最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }     //最小公倍数
using Graph = vector<vector<ll>>;
ll inf=300000000000000000;
const double PI = 3.14159265358979323846;
int main(){
  int n;
  cin >> n;
  pair<int,int> k[n];
  rep(i,n){
    int a,b;
    cin >> a >> b;
    k[i]=make_pair(a,b);
  }
  sort(k,k+n);
  int u[n];
  u[n-1]=k[n-1].second;
  rep(i,n-1){
    u[n-2-i]=min(u[n-1-i],k[n-2-i].second);
  }
  int v[n];
  v[0]=k[0].second;
  rep(i,n-1){
    u[i+1]=min(u[i],k[i+1].second);
  }
  int ans=0;
  rep()
}   


Compiler output:
a.cc:31:7: error: macro "rep" requires 2 arguments, but only 1 given
   31 |   rep()
      |       ^
a.cc:3:9: note: macro "rep" defined here
    3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:31:3: error: 'rep' was not declared in this scope
   31 |   rep()
      |   ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
#define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

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

ll gcd(ll n, ll m)
{
	ll tmp;
	while (m != 0)
	{
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m)
{
	return abs(n) / gcd(n, m) * abs(m); //gl=xy
}

using namespace std;

void solve()
{
  int t;
  cin>>t;
  while(t--){
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    if(a<b){
      cout<<"No\n";
    }
    else if(b>d){
      cout<<"No\n";
    }
    else if((c+1)>=b){
      cout<<"Yes\n";
    }
    else {
      if(b-g+a%b>c){
        cout<<"No\n";
      }
      else{
        cout<<"Yes\n";
      }
    }
  }
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:71:12: error: 'g' was not declared in this scope
   71 |       if(b-g+a%b>c){
      |            ^