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

#include <bits/stdc++.h>
using namespace std;
int main() {
long long N;
cin>>N;
long long counter=0;
long long a[N]={};
for(long long i=0;i<N;i++){
cin>>a[i];}
for(long long i=0;i<N-2;i++){
if(a[i]==a[i+1]){
if(a[i+1]==a[i+2]){
counter++;
i++;
continue;}
else{
counter++;
i++;
continue;}}
else{
continue;}}
cout<<counter<<endl;}
while(b>0){
counter+=b%10;
b/=10;}
c=min(counter,c);
counter=0;}
cout<<c<<endl;}


Compiler output:
a.cc:23:1: error: expected unqualified-id before 'while'
   23 | while(b>0){
      | ^~~~~
a.cc:26:1: error: 'c' does not name a type
   26 | c=min(counter,c);
      | ^
a.cc:27:1: error: 'counter' does not name a type
   27 | counter=0;}
      | ^~~~~~~
a.cc:27:11: error: expected declaration before '}' token
   27 | counter=0;}
      |           ^
a.cc:28:1: error: 'cout' does not name a type
   28 | cout<<c<<endl;}
      | ^~~~
a.cc:28:15: error: expected declaration before '}' token
   28 | cout<<c<<endl;}
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
long long N;
cin>>N;
long long counter=0;
long long a[N]={};
for(long long i=0;i<N;i++){
cin>>a[i];}
for(long long i=0;i<N;i++){
if(a[i]==a[i+1]){
if(a[i+1]==a[i+2]){
counter++;
i++;
continue;}
else{
counter++;
i++;
continue;}}
else{
continue;}}
cout<<counter<<endl;}
while(b>0){
counter+=b%10;
b/=10;}
c=min(counter,c);
counter=0;}
cout<<c<<endl;}


Compiler output:
a.cc:23:1: error: expected unqualified-id before 'while'
   23 | while(b>0){
      | ^~~~~
a.cc:26:1: error: 'c' does not name a type
   26 | c=min(counter,c);
      | ^
a.cc:27:1: error: 'counter' does not name a type
   27 | counter=0;}
      | ^~~~~~~
a.cc:27:11: error: expected declaration before '}' token
   27 | counter=0;}
      |           ^
a.cc:28:1: error: 'cout' does not name a type
   28 | cout<<c<<endl;}
      | ^~~~
a.cc:28:15: error: expected declaration before '}' token
   28 | cout<<c<<endl;}
      |               ^
Language: C++

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

#define i_cin(X) scanf("%d", &X)
#define i_cin2(X,Y) scanf("%d %d",&X,&Y)
#define i_cin3(X,Y,Z) scanf("%d %d %d",&X,&Y,&Z)
#define l_cin(X) scanf("%ld",&X)
#define s_cin(X) scanf("%s",&X)


#define  i_cout(X) printf("%d\n",X)
#define  i_cout2(X,Y) printf("%d %d\n",X,Y)
#define  l_cout(X) printf("%ld\n",X)
#define  s_cout(X) printf("%s\n",X)
#define  ll_cout(X) printf("%lld\n",X)

void i_cins(int n, int* A);

int main(void) {
	int   N, A[101],i,cnt=0;
	i_cin(N);
	i_cins(N, A);
	for (i = 0;i < N-1;i++)
	{
		if (A[i] == A[i + 1]) {
			cnt++; A[i + 1] = 10001;
		}
	}
	i_cout(cnt);
	return 0;
}

void i_cins(int n, int* A) {
	int i;
	for (i = 0; i < n; i++) 
		i_cin(*(A + i));
	return 0;
}



Compiler output:
a.cc: In function 'void i_cins(int, int*)':
a.cc:39:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   39 |         return 0;
      |                ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: expected ';' before 'for'
    6 |   cin>>C.at(0)
      |               ^
      |               ;
    7 |   for(int i=1;i<N;i++){
      |   ~~~          
a.cc:7:15: error: 'i' was not declared in this scope
    7 |   for(int i=1;i<N;i++){
      |               ^
Language: C++

#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}


int main(){
  
  int n;
  cin>>n;
  int a[n];
  REP(i,n){
    cin>>a[i];
  }
  int ans = 0;
  int temp = 0;
  char now;
  REP(i,n){
    if(i==0){
      now = s[i];
      temp = 1;
      continue;
    }
    if(now == s[i]){
      temp++;
      now = s[i];
      if(i == n-1){
        ans += temp/2;
      }
    }else{
      ans += temp/2;
      temp = 1;
      now = s[i];
      if(i == n-1){
        ans += temp/2;
      }
    }
  }
  cout<<ans<<endl;  
  return 0; 
}


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

#include <iostream>using namespace std;typedef int I;I main() {I n,c=0;cin >> n;I l[100];for (int i = 0; i < n; i++) cin >> l[i],i > 0 ? l[i - 1] == l[i] ? c++,i++ :0:0;cout << c << endl;}

Compiler output:
a.cc:1:26: warning: extra tokens at end of #include directive
    1 | #include <iostream>using namespace std;typedef int I;I main() {I n,c=0;cin >> n;I l[100];for (int i = 0; i < n; i++) cin >> l[i],i > 0 ? l[i - 1] == l[i] ? c++,i++ :0:0;cout << c << endl;}
      |                          ^~~~~~~~~
a.cc:1:10: fatal error: iostream>usin: No such file or directory
    1 | #include <iostream>using namespace std;typedef int I;I main() {I n,c=0;cin >> n;I l[100];for (int i = 0; i < n; i++) cin >> l[i],i > 0 ? l[i - 1] == l[i] ? c++,i++ :0:0;cout << c << endl;}
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

using namespace std:

int main (){
  int a,b[110],c;
  cin >> a;
  
  for(int i=0;i<a;i++)
    cin >> b[i];
  
  c =0;
  for(int i=1;i<a;i++){
    if(b[i] ==b[i-1]){
      b[i] = 0;
      c++;
    }
  }
  cout << c << endl;
  
  return 0;
}
  
    

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,p=0,a=0;cin>>n;
  vector<int>s(n),c(1);for(int i=0;i<n;i++)cin>>s.at(i);a.at(0)=1;
  for(int i=1;i<n;i++){
    if(s.at(i)==s.at(i-1))c.at(p)++;
    else{c.push_back(1);p++;}
  }
  for(int i=0;i<=p;i++)a+=c.at(i)/2;
  cout<<a<<endl;
}

  


Compiler output:
a.cc: In function 'int main()':
a.cc:5:59: error: request for member 'at' in 'a', which is of non-class type 'int'
    5 |   vector<int>s(n),c(1);for(int i=0;i<n;i++)cin>>s.at(i);a.at(0)=1;
      |                                                           ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,p=0,a=0;cin>>n;
  vector<int>s(n),c(1);for(int i=0;i<n;i++)cin>>s.at(i);a.at(0)=1;
  for(int i=1;i<n;i++){
    if(s.at(i)==s.at(i-1))c.at(p)++;
    else{c.push_back(1);p++;}
  }
  for(int i=0;i<=p:i++)a+=c.at(i)/2;
  cout<<a<<endl;
}

  


Compiler output:
a.cc: In function 'int main()':
a.cc:5:59: error: request for member 'at' in 'a', which is of non-class type 'int'
    5 |   vector<int>s(n),c(1);for(int i=0;i<n;i++)cin>>s.at(i);a.at(0)=1;
      |                                                           ^~
a.cc:10:15: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   10 |   for(int i=0;i<=p:i++)a+=c.at(i)/2;
      |               ^
a.cc:10:19: error: found ':' in nested-name-specifier, expected '::'
   10 |   for(int i=0;i<=p:i++)a+=c.at(i)/2;
      |                   ^
      |                   ::
a.cc:10:18: error: 'p' is not a class, namespace, or enumeration
   10 |   for(int i=0;i<=p:i++)a+=c.at(i)/2;
      |                  ^
a.cc:12:1: error: expected primary-expression before '}' token
   12 | }
      | ^
a.cc:11:17: error: expected ')' before '}' token
   11 |   cout<<a<<endl;
      |                 ^
      |                 )
   12 | }
      | ~                
a.cc:10:6: note: to match this '('
   10 |   for(int i=0;i<=p:i++)a+=c.at(i)/2;
      |      ^
a.cc:12:1: error: expected primary-expression before '}' token
   12 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
#define rep(i, n) for(int i = 0; i < (n); i++)

///////////////////////////
int main() {
  int n,ans=0;
  cin>>n;
  int a[n];
  vector<int> v(n),a(n);
  rep(i,n) a[i]=0;
  rep(i,n) cin>>v[i];
  rep(i,n-1){
    int k=0;
    if(v[i]==v[i+1]){
      a[k]++;
    }else{
      k++;
    }
    
  }
  rep(i,n){
    ans+=a[i]/2;
  }
  cout<<ans<<endl;
}
///////////////////////////


Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: conflicting declaration 'std::vector<int> a'
   11 |   vector<int> v(n),a(n);
      |                    ^
a.cc:10:7: note: previous declaration as 'int a [n]'
   10 |   int a[n];
      |       ^
Language: C++

v#include<bits/stdc++.h>
using namespace std;
int pas,n,ans,x;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&x);
		if(pas==x)ans++,pas=0;
		else pas=x;
	}
	printf("%d",ans);
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include<bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include<bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:6:9: error: 'scanf' was not declared in this scope
    6 |         scanf("%d",&n);
      |         ^~~~~
a.cc:13:9: error: 'printf' was not declared in this scope
   13 |         printf("%d",ans);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | v#include<bits/stdc++.h>
Language: C++

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

int main(){
  int  N;
  scanf("%d", &N);
  vector<int> slimes(N);
  for(int i = 0; i < N; i++){
  	scanf("%d", &a[i]);
  }
  answer = 0;
  for(int i = 0; i < N; i++){
  	int group_size = 1;
    while(i+1 < N && a[i] == a[i+1]){
    	group_size++;
    	i++;  
    }
    answer += (group_size/2)
  }
  cout << answer;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: 'a' was not declared in this scope
    9 |         scanf("%d", &a[i]);
      |                      ^
a.cc:11:3: error: 'answer' was not declared in this scope
   11 |   answer = 0;
      |   ^~~~~~
a.cc:14:22: error: 'a' was not declared in this scope
   14 |     while(i+1 < N && a[i] == a[i+1]){
      |                      ^
Language: C++

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

int main(){
  int  N;
  scanf("%d", &N);
  vector<int> slimes(N);
  for(int i = 0; i < N; i++){
  	scanf("%d", &a[i]);
  }
  answer = 0;
  for(int i = 0; i < N; i++){
  	int group_size = 1;
    while(i+1 < N && a[i] == a[i+1]){
    	group_size++;
    	i++;  
    }
    answer += (group_size/2)
  }
  cout << answer;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: 'a' was not declared in this scope
    9 |         scanf("%d", &a[i]);
      |                      ^
a.cc:11:3: error: 'answer' was not declared in this scope
   11 |   answer = 0;
      |   ^~~~~~
a.cc:14:22: error: 'a' was not declared in this scope
   14 |     while(i+1 < N && a[i] == a[i+1]){
      |                      ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: 'count' was not declared in this scope
   17 |   count<<ans<<endl;
      |   ^~~~~
Language: C++

#include <iostream>
#include <vector>
usingnamespace std;

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


Compiler output:
a.cc:3:1: error: 'usingnamespace' does not name a type
    3 | usingnamespace std;
      | ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   int N;cin>>N;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> a;
      |   ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> a;
      |          ^~~
a.cc:8:30: error: 'a' was not declared in this scope
    8 |   for (int i=0;i<N;++i) cin>>a[i];
      |                              ^
a.cc:12:9: error: 'a' was not declared in this scope
   12 |     if (a[i]==a[i-1]){
      |         ^
a.cc:17:3: error: 'count' was not declared in this scope
   17 |   count<<ans<<endl;
      |   ^~~~~
a.cc:17:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   17 |   count<<ans<<endl;
      |               ^~~~
      |               std::endl
In file included from /usr/include/c++/14/iostream:41:
/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 namespase std;
int n,a[101],kol,ans=0;
int main(){
	cin>>n;
    for (int i=1; i<=n; i++) cin>>a[i];
    for (int i=1; i<=n; i++){
      kol++;
      if (i==n || a[i+1]!=a[i]) {ans+=kol/2; kol=0; }
    }
    cout<<kol;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespase'
    2 | using namespase std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |         cin>>n;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |     cout<<kol;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;cin >> N;
  int pre = -1, cnt = 0;
  for(int i = 0; i < N; ++V){
    int x; cin >> x;
    if(x == pre){
      cnt++;
      x = -1;
    }
    pre = x;
  }
  cout << cnt << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:27: error: 'V' was not declared in this scope
    6 |   for(int i = 0; i < N; ++V){
      |                           ^
Language: C++

#include <Header.hpp>
const int MAXN = 6.1e3;

int    posA[ MAXN ], posB[ MAXN ];
string dp[ MAXN ];
bool cmp(const string&a, const string&b)
{
    int pa=0,pb=0;
    while(pa<a.size()&&pb<b.size())
    {
        if (a[pa]==' ') pa++;
        else if (b[pb]==' ') pb++;
        else if (a[pa]!=b[pb]) return a[pa]<b[pb];
        else pa++,pb++;
    }
    return (pa>pb);
}
int    main()
{
    int    n;
    string s;
    IO::R(n, s);
    int ka = 0, kb = 0;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[ i ] == 'a') posA[ ++ka ] = i;
        if (s[ i ] == 'b') posB[ ++kb ] = i;
    }
    for (int i = 0; i <= n; i++) { dp[ i ] = string(s.size(),' '); }
    for (int i=1;i<=n;i++)
    {
        for (int j=0;j<i;j++)
        {
            string t=dp[j];
            t[posA[i]]='a';t[posB[i]]='b';
            if (cmp(dp[i],t)) dp[i]=t;
        }
    }
    for (auto i:dp[n])
    {
        if (i!=' ') IO::W(i);
    }
    return 0;
}

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

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

int main(){
 
  long long Y,ans;
  ans=0;
 cin>>Y;
  vector<int>a(Y);

for(int i=0;i<Y;i++){
cin>>a[i]
  if(i!=0){
  if(a[i]=a[i-1]){
    a[i]=0;
    ans++;
  }
  }
}
 
    cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: expected ';' before 'if'
   12 | cin>>a[i]
      |          ^
      |          ;
   13 |   if(i!=0){
      |   ~~
Language: C++

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


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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'int'
    9 |   int a[N];
      |   ^~~
a.cc:12:10: error: 'a' was not declared in this scope
   12 |     cin>>a[i];
      |          ^
Language: Java

import java.util.*;
import java.io.*;
 public class c1
{
     static class InputReader {
        private InputStream stream;
        private byte[] inbuf = new byte[1024];
        private int lenbuf = 0;
        private int ptrbuf = 0;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        private int readByte() {
            if (lenbuf == -1) throw new UnknownError();
            if (ptrbuf >= lenbuf) {
                ptrbuf = 0;
                try {
                    lenbuf = stream.read(inbuf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (lenbuf <= 0) return -1;
            }
            return inbuf[ptrbuf++];
        }

        private boolean isSpaceChar(int c) {
            return !(c >= 33 && c <= 126);
        }

        private int skip() {
            int b;
            while ((b = readByte()) != -1 && isSpaceChar(b)) ;
            return b;
        }

        public String next() {
            int b = skip();
            StringBuilder sb = new StringBuilder();
            while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

        public int nextInt() {
            int num = 0, b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }

            while (true) {
                if (b >= '0' && b <= '9') {
                    num = num * 10 + (b - '0');
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

        public long nextLong() {
            long num = 0;
            int b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }

            while (true) {
                if (b >= '0' && b <= '9') {
                    num = num * 10 + (b - '0');
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }
    }
    public static void main(String args[])
    {
        InputReader sc=new InputReader(System.in);
        int n;
        n=sc.nextInt();
        int a[]=new int[n];
        for(int i=0;i<n;i++)
        {
            a[i]=sc.nextInt();
        }
        int count=0;
        for(int i=1;i<n;i++)
        {
            if(a[i]!=a[i-1])
            continue;
            else
            {
              a[i]=1000;
              count++;
            }
        }
        System.out.println(count);
    }
}

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

#include<iostream>
#include<set>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repe(i, n) for(int i = 0; i <= (int)(n); i++)
#define rep1(i, n) for(int i = 1; i < (int)(n); i++)

#include <algorithm>
using namespace std;
#include <cmath>
#include <string>
#define elif else if
typedef long long ll;

int main(){
  int N;
  cin>>N;
  int A[105];
  rep(i,N)cin>>A[i];
  int ans=0;
  rep1(i,N){
    if(A[i-1]==A[i]){
      ans++;
      a[i]=-1;	
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:7: error: 'a' was not declared in this scope
   23 |       a[i]=-1;
      |       ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int n, a[105], ans;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: expected primary-expression before ',' token
    8 |         scanf("%d%d", &n,, &a[0]);
      |                          ^
Language: C++

#include <iostream>
#include <ios> 
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>
#include <map>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)

using namespace std;
typedef long long int lli;
//const int MAX=;
//const int MOD=1e9+7;


int main(){
	int N;
	cin>>N;
	int a[100];
	rep(i,N)cin>>a[i];
	int slime=500;
	int ans=0;
	rep(1,N-1){
		if(a[i]==a[i-1]){
			ans++;
			a[i]=slime;
		}
	}
	cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: lvalue required as left operand of assignment
   13 | #define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
      |                      ^~~~~~~
a.cc:29:9: note: in expansion of macro 'rep'
   29 |         rep(1,N-1){
      |         ^~~
a.cc:29:13: error: lvalue required as increment operand
   29 |         rep(1,N-1){
      |             ^
a.cc:13:41: note: in definition of macro 'rep'
   13 | #define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
      |                                         ^
a.cc:30:22: error: 'i' was not declared in this scope
   30 |                 if(a[i]==a[i-1]){
      |                      ^
Language: C++

#include <iostream>
using namespace std;

int main(){	
  int N;
  cin>>N;
  vector<int> v;
  int cnt=1;
  int res =0;
  for(int i=0;i<N; i++){
    cin>>v[i];
    if(i>0 )
      if( v[i-1] != v[i])
      {
        res+=cnt/2;
      }
      else{
  		  cnt++;
      }

      
  }
  
  
  cout<<res;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> v;
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> v;
      |          ^~~
a.cc:11:10: error: 'v' was not declared in this scope
   11 |     cin>>v[i];
      |          ^
Language: C++

/*input
5
1 1 2 2 2
*/
#include<iostream>
using namespace std;

#define int long long 
#define double long double

typedef pair<int,int> pi;

typedef vector<int> vi;
typedef vector<pi> vpi;

#define f first
#define s second
#define mp make_pair
#define pb push_back

#define gcd __gcd

const int INF = 1e18+1;
const int MOD = 1e9+7;
const double PI = 3.14159265358979323846264338;

int fast_ex(int a,int n,int m){
  if(n == 0)return 1;
  if(n == 1)return a;
  int x = 1;
    x *= fast_ex(a,n/2,m);
    x %= m;
    x *= x;
    x %= m;
    if(n%2)x*= a;
    x %= m;
    return x;
}

signed main(){
  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  int n;
  int pref = 1;
  int ans = 0;
  int prev;
  cin >> n;n--;
  cin >> prev;
  while(n--){
      int now;cin >> now;
      if(now == prev)pref++;
      else { 
      	ans += (pref)/2;
      	pref = 1;
      }
      prev = now;
  }
  ans += pref/2;
  cout << ans;
  return 0;
}

Compiler output:
a.cc:13:9: error: 'vector' does not name a type
   13 | typedef vector<int> vi;
      |         ^~~~~~
a.cc:14:9: error: 'vector' does not name a type
   14 | typedef vector<pi> vpi;
      |         ^~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: invalid types 'int[int]' for array subscript
   11 |       if(a[i] == a[j]) count++;
      |           ^
a.cc:11:19: error: invalid types 'int[int]' for array subscript
   11 |       if(a[i] == a[j]) count++;
      |                   ^
Language: C

#include<stdio.h>

int main() {
	
	int n, a[106] = {},memo=0,result=0,count=1;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}
	for (int i = 0; i < n; i++) {
		
		if (memo == a[i]) {
			count++;
		}
		else {
			result += count / 2;
			count = 1;
			memo=a[i]
		}
	}
	printf("%d", result);
}

Compiler output:
main.c: In function 'main':
main.c:18:34: error: expected ';' before '}' token
   18 |                         memo=a[i]
      |                                  ^
      |                                  ;
   19 |                 }
      |                 ~
Language: C++

#include <iostream>
#include <string>
#include <unordered_map>

using namespace std;

int N;
string S;

struct pair_hash {
	template <class T1, class T2>
	std::size_t operator () (const std::pair<T1, T2> &p) const {
		auto h1 = std::hash<T1>{}(p.first);
		auto h2 = std::hash<T2>{}(p.second);

		// Mainly for demonstration purposes, i.e. works but is overly simple
		// In the real world, use sth. like boost.hash_combine
		return h1 ^ h2;
	}
};

using P = pair<string, string>;

void solve() {
	long long ans;
	cin >> N >> S;
	string S1, S2;
	S1 = S.substr(0, N);
	S2 = S.substr(N, N);
	reverse(S2.begin(), S2.end());

	unordered_map<P, int, pair_hash> um;
	for (int Nbits_i = 0; Nbits_i < 1 << N; Nbits_i++)
	{
		string A1 = "", B1 = "";
		for (int S1_i = 0; S1_i < N; S1_i++)
		{
			if (Nbits_i >> S1_i & 1) {
				A1 += S1[S1_i];
			}
			else {
				B1 += S1[S1_i];
			}
		}
		um[P(A1, B1)]++;
	}
	long long sum = 0;
	for (int Nbits_i = 0; Nbits_i < 1 << N; Nbits_i++)
	{
		string A2 = "", B2 = "";
		for (int S2_i = 0; S2_i < N; S2_i++)
		{
			if (Nbits_i >> S2_i & 1) {
				A2 += S2[S2_i];
			}
			else {
				B2 += S2[S2_i];
			}
		}
		sum += um[P(A2, B2)];
	}

	ans = sum;
	cout << ans << "\n";
}

int main() {
	solve();

	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:30:9: error: 'reverse' was not declared in this scope
   30 |         reverse(S2.begin(), S2.end());
      |         ^~~~~~~
Language: C++

#include<stdio.h>

void main(void)
{
	int count = 0;
	int X = 0;
	int Y = 0;
	int T = 0;
	int temp1 = 0;
	int temp2 = 0;
	int temp3 = 0;
	int flag = 0;
	scanf("%d",&T);
	unsigned long long int pat[T][4];
	for(Y = 0;Y < T;Y++)
	{
		for(X = 0;X < 4;X++)
		{
			scanf("%d",&pat[Y][X]);
		}
	}

	for(Y=0;Y<T;Y++)
	{
		if(pat[T][0] < pat[T][1])
		{
			flag = 1;
		}
		else if(pat[T][1] > pat[T][3])
		{
			flag = 1;
		}
		else if(pat[T][2] < pat[T][1])
		{
			flag = 1;
		}

		if(flag == 1)
		{
			printf("NO\n");
		}else
		{
			printf("YES\n");
		}
	}

}


Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main(void)
      | ^~~~
Language: C

#include <stdio.h>

int main(int argc, char const *argv[]) {
  int N, cnt = 0;
  int a[100];

  scanf("%d\n", &N);

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

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

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:17:32: error: expected ';' before 'cnt'
   17 |         else a[i + 1] = a[i] -2
      |                                ^
      |                                ;
   18 | 
   19 |         cnt++;
      |         ~~~
Language: C

#include<stdio.h>

int main()
{
	int i,n,s[110],c=1;
	scanf("%d",&n);
	s[0]=0;
	for(i=1;i<=n;i++)
	{
		scanf("%d",&(s[i]));
		if(s[i]==s[i-1])c++;
		else c=1;
		if(c%2==0)ans++;
	}
	printf("%d",ans);
}

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

#include<stdio.h>
int main(){
int n,a,k,c;a=0;c=114;
int s[101];
scanf("%d",&k);
for(n=0;n<k;n++){
scanf("%d",&s[n]);}
for(n=1;n<k;n++){
if(s[n-1]==s[n]){
a++;s[n]=c;c++;}}
printf("%d",&a);
return 0+}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: expected primary-expression before '}' token
   12 | return 0+}
      |          ^
a.cc:12:10: error: expected ';' before '}' token
   12 | return 0+}
      |          ^
      |          ;
Language: C++

use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let mut sc = io::Scanner::new(&buf);

    let n: usize = sc.next();
    let a: Vec<usize> = sc.vec(n);

    let mut ans = 0;
    let mut i = 0;
    while i < n {
        if i + 1 < n && a[i] == a[i+1] {
            ans += 1;
            i += 2;
        } else {
            i += 1;
        }
    }

    println!("{}", ans);
}

pub mod io {
    pub struct Scanner<'a> {
        iter: ::std::str::SplitWhitespace<'a>,
    }

    impl<'a> Scanner<'a> {
        pub fn new(s: &'a str) -> Scanner<'a> {
            Scanner {
                iter: s.split_whitespace(),
            }
        }

        pub fn next<T: ::std::str::FromStr>(&mut self) -> T {
            if let Ok(v) = self.iter.next().unwrap().parse() {
                v
            } else {
                panic!("parsing failed")
            }
        }

        pub fn vec<T: ::std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
            (0..n).map(|_| self.next()).collect()
        }
    }
}



Compiler output:
a.cc:27:24: warning: missing terminating ' character
   27 |     pub struct Scanner<'a> {
      |                        ^
a.cc:27:24: error: missing terminating ' character
   27 |     pub struct Scanner<'a> {
      |                        ^~~~~
a.cc:28:43: warning: missing terminating ' character
   28 |         iter: ::std::str::SplitWhitespace<'a>,
      |                                           ^
a.cc:28:43: error: missing terminating ' character
   28 |         iter: ::std::str::SplitWhitespace<'a>,
      |                                           ^~~~
a.cc:31:10: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
   31 |     impl<'a> Scanner<'a> {
      |          ^~~~~~~~~~~~~~
a.cc:32:24: warning: multi-character literal with 18 characters exceeds 'int' size of 4 bytes
   32 |         pub fn new(s: &'a str) -> Scanner<'a> {
      |                        ^~~~~~~~~~~~~~~~~~~~~
a.cc:47:14: error: too many decimal points in number
   47 |             (0..n).map(|_| self.next()).collect()
      |              ^~~~
a.cc:1:1: error: 'use' does not name a type
    1 | use std::io::Read;
      | ^~~
a.cc:3:1: error: 'fn' does not name a type
    3 | fn main() {
      | ^~
a.cc:26:1: error: 'pub' does not name a type
   26 | pub mod io {
      | ^~~
a.cc:31:5: error: 'impl' does not name a type
   31 |     impl<'a> Scanner<'a> {
      |     ^~~~
a.cc:50:1: error: expected declaration before '}' token
   50 | }
      | ^
Language: C++

use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let mut iter = buf.split_whitespace();

    let n: usize = iter.next().unwrap().parse().unwrap();
    let a: Vec<usize> = (0..n)
        .map(|_| iter.next().unwrap().parse().unwrap())
        .collect();

    let mut ans = 0;
    let mut i = 0;
    while i < n {
        if i + 1 < n && a[i] == a[i+1] {
            ans += 1;
            i += 2;
        } else {
            i += 1;
        }
    }

    println!("{}", ans);
}


Compiler output:
a.cc:10:26: error: too many decimal points in number
   10 |     let a: Vec<usize> = (0..n)
      |                          ^~~~
a.cc:1:1: error: 'use' does not name a type
    1 | use std::io::Read;
      | ^~~
a.cc:3:1: error: 'fn' does not name a type
    3 | fn main() {
      | ^~
Language: C++

N = input()

v = map(int, raw_input().split(' '))

found = 0

i = 0
while i < N - 1:
	if v[i - 1] == v[i]:
		found += 1
		i += 1

	i += 1

print found

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = input()
      | ^
Language: C++

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

int gcd (int x,int y){
   int r=x%y;
   while(r!=0){
     a=b;
     b=r;
     r=a%b;
}
return b;
}

int main(){
	int t;
	long long a, b, c, d;
	cin >> t;
	for (int i = 0; i < t; i++) {
		cin >> a >> b >> c >> d;
 
		long long z = gcd(b, d);
 
		if (a >= b && b <= d && a % z <= c)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
 
	return 0;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:7:6: error: 'a' was not declared in this scope
    7 |      a=b;
      |      ^
a.cc:7:8: error: 'b' was not declared in this scope
    7 |      a=b;
      |        ^
a.cc:11:8: error: 'b' was not declared in this scope
   11 | return b;
      |        ^
Language: C++

using namespace std;
using namespace std;
 
long long yuukuriddo(long long x, long long y) {
	if (y == 0)
		return x;
	else
		gcd(y, x%y);
}
 
int main(){
	int t;
	long long a, b, c, d;
	cin >> t;
	for (int i = 0; i < t; i++) {
		cin >> a >> b >> c >> d;
 
		long long z = yuukuriddo(b, d);
 
		if (a >= b && b <= d && a % z <= c)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
 
	return 0;
}

Compiler output:
a.cc: In function 'long long int yuukuriddo(long long int, long long int)':
a.cc:8:17: error: 'gcd' was not declared in this scope
    8 |                 gcd(y, x%y);
      |                 ^~~
a.cc: In function 'int main()':
a.cc:14:9: error: 'cin' was not declared in this scope
   14 |         cin >> t;
      |         ^~~
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:21:25: error: 'cout' was not declared in this scope
   21 |                         cout << "Yes" << endl;
      |                         ^~~~
a.cc:21:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:42: error: 'endl' was not declared in this scope
   21 |                         cout << "Yes" << 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;
a.cc:23:25: error: 'cout' was not declared in this scope
   23 |                         cout << "No" << endl;
      |                         ^~~~
a.cc:23:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:41: error: 'endl' was not declared in this scope
   23 |                         cout << "No" << endl;
      |                                         ^~~~
a.cc:23:41: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc: In function 'long long int yuukuriddo(long long int, long long int)':
a.cc:9:1: warning: control reaches end of non-void function [-Wreturn-type]
    9 | }
      | ^
Language: C++

<?php
fscanf(STDIN,"%d",$n);
$arr = array();
for($i = 0;$i < $n;$i++)
{
    fscanf(STDIN,"%d",$number);
	array_push($arr,$number);
}
$continous = 1;
$answer = 0;
$value = $arr[0];
for($i = 1;$i < $n;$i++)
{
   if($arr[$i] == $arr[$i-1])
        $continous++;
   else {
   	$answer += (int)($continous/2);
   	$continous = 1;
   }
}
$answer += (int)($continous/2);
printf("%d\n",$answer);


Compiler output:
a.cc:1:1: error: expected unqualified-id before '<' token
    1 | <?php
      | ^
a.cc:3:1: error: '$arr' does not name a type
    3 | $arr = array();
      | ^~~~
a.cc:4:1: error: expected unqualified-id before 'for'
    4 | for($i = 0;$i < $n;$i++)
      | ^~~
a.cc:4:12: error: '$i' does not name a type
    4 | for($i = 0;$i < $n;$i++)
      |            ^~
a.cc:4:20: error: '$i' does not name a type
    4 | for($i = 0;$i < $n;$i++)
      |                    ^~
a.cc:9:1: error: '$continous' does not name a type
    9 | $continous = 1;
      | ^~~~~~~~~~
a.cc:10:1: error: '$answer' does not name a type
   10 | $answer = 0;
      | ^~~~~~~
a.cc:11:1: error: '$value' does not name a type
   11 | $value = $arr[0];
      | ^~~~~~
a.cc:12:1: error: expected unqualified-id before 'for'
   12 | for($i = 1;$i < $n;$i++)
      | ^~~
a.cc:12:12: error: '$i' does not name a type
   12 | for($i = 1;$i < $n;$i++)
      |            ^~
a.cc:12:20: error: '$i' does not name a type
   12 | for($i = 1;$i < $n;$i++)
      |                    ^~
a.cc:21:1: error: '$answer' does not name a type
   21 | $answer += (int)($continous/2);
      | ^~~~~~~
a.cc:22:7: error: expected constructor, destructor, or type conversion before '(' token
   22 | printf("%d\n",$answer);
      |       ^
Language: C++

public class Main {
    public static void main(String [] args) {
        final Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        int [] color = new int[n];
        for (int i = 0; i < n; ++i) {
            color[i] = sc.nextInt();
        }
        int count = 0;
        for (int i = 1; i < n; ++i) {
            if (color[i] == color[i - 1]) {
                ++count;
                if (i + 1 < n && color[i - 1] - 1 != color[i + 1]) {
                    color[i] = color[i] - 1;
                } else {
                    color[i] = color[i - 1] + 1;
                }
            }
        }
        System.out.println(count);
    }
}


Compiler output:
a.cc:1:1: error: expected unqualified-id before 'public'
    1 | public class Main {
      | ^~~~~~
Language: C++


import java.util.Scanner;



public class Main {
    public static void main(String [] args) {
        final Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        int [] color = new int[n];
        for (int i = 0; i < n; ++i) {
            color[i] = sc.nextInt();
        }
        int count = 0;
        for (int i = 1; i < n; ++i) {
            if (color[i] == color[i - 1]) {
                ++count;
                if (i + 1 < n && color[i - 1] - 1 != color[i + 1]) {
                    color[i] = color[i] - 1;
                } else {
                    color[i] = color[i - 1] + 1;
                }
            }
        }
        System.out.println(count);
    }
}


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

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

long long gcd(long long a, long long b) {
   if(b == 0) return a;
   return gcd(b, a % b);
}

void solve() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;

  if (d < b || a < b) {
    cout << "No" << endl;
    return;
  }

  if (b <= c + 1) {
    cout << "Yes" << endl;
    return;
  }

  long long g = gcd(b, d);
  long long k =  ((double) b - a % b + g - 1) / g  - 1;
  long long mx = a % b + k * g;
  if (mx <= c) {
    cout << "Yes" << endl;
    return 0;
  }

  cout << "No" << endl;

}


Compiler output:
a.cc: In function 'void solve()':
a.cc:28:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
   28 |     return 0;
      |            ^
Language: C++

int main() {
	int a, b;
  	cin >> a >>b;
  	int c = a * b;
  	if (c % 2 == 0) cout << "Even" << endl;
  	else cout << "Odd" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> a >>b;
      |         ^~~
a.cc:5:25: error: 'cout' was not declared in this scope
    5 |         if (c % 2 == 0) cout << "Even" << endl;
      |                         ^~~~
a.cc:5:43: error: 'endl' was not declared in this scope
    5 |         if (c % 2 == 0) cout << "Even" << endl;
      |                                           ^~~~
a.cc:6:14: error: 'cout' was not declared in this scope
    6 |         else cout << "Odd" << endl;
      |              ^~~~
a.cc:6:31: error: 'endl' was not declared in this scope
    6 |         else cout << "Odd" << endl;
      |                               ^~~~
Language: Java

import java.util.Scanner;

public class A {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] a = new int[n];
		int count = 0;
		for(int i = 0; i < n; i++) {
			a[i] = scan.nextInt();
		}
		int i = 1;
		do {
			if(a[i] == a[i-1]){
				count++;
				i++;
			}
			i++;
		} while(i < n);
		System.out.println(count);
	}
}

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

# include<>

using namespace std;

int main(){
  int total_N;
  int slimes[];
  int window[3];
  int count;
  
  cin >> total_N;
  cin >> slimes;
  
  for(i=0; i<slimes.size()-window.size(); i++){
    window = slimes[i:i+window.size()];
    num_1 = window.pop(1);
    num_2 = window.pop(1);
    num_3 = window.pop(1);
    if((num_1 == num_2)or(num_2 == num_3)or(num_3 == num_1)){
      count+=1
    }
  }
  return 0;
}

Compiler output:
a.cc:1:10: error: empty filename in #include
    1 | # include<>
      |          ^~
a.cc: In function 'int main()':
a.cc:7:7: error: storage size of 'slimes' isn't known
    7 |   int slimes[];
      |       ^~~~~~
a.cc:11:3: error: 'cin' was not declared in this scope
   11 |   cin >> total_N;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | # include<>
a.cc:14:7: error: 'i' was not declared in this scope
   14 |   for(i=0; i<slimes.size()-window.size(); i++){
      |       ^
a.cc:14:35: error: request for member 'size' in 'window', which is of non-class type 'int [3]'
   14 |   for(i=0; i<slimes.size()-window.size(); i++){
      |                                   ^~~~
a.cc:15:22: error: found ':' in nested-name-specifier, expected '::'
   15 |     window = slimes[i:i+window.size()];
      |                      ^
      |                      ::
a.cc:15:21: error: 'i' is not a class, namespace, or enumeration
   15 |     window = slimes[i:i+window.size()];
      |                     ^
a.cc:15:32: error: request for member 'size' in 'window', which is of non-class type 'int [3]'
   15 |     window = slimes[i:i+window.size()];
      |                                ^~~~
a.cc:16:5: error: 'num_1' was not declared in this scope
   16 |     num_1 = window.pop(1);
      |     ^~~~~
a.cc:16:20: error: request for member 'pop' in 'window', which is of non-class type 'int [3]'
   16 |     num_1 = window.pop(1);
      |                    ^~~
a.cc:17:5: error: 'num_2' was not declared in this scope
   17 |     num_2 = window.pop(1);
      |     ^~~~~
a.cc:17:20: error: request for member 'pop' in 'window', which is of non-class type 'int [3]'
   17 |     num_2 = window.pop(1);
      |                    ^~~
a.cc:18:5: error: 'num_3' was not declared in this scope
   18 |     num_3 = window.pop(1);
      |     ^~~~~
a.cc:18:20: error: request for member 'pop' in 'window', which is of non-class type 'int [3]'
   18 |     num_3 = window.pop(1);
      |                    ^~~
a.cc:20:15: error: expected ';' before '}' token
   20 |       count+=1
      |               ^
      |               ;
   21 |     }
      |     ~
Language: C++

#include<iostream>
using namespace std;
int main()
{
	int N;
	cin >> N;
	int pv=0,v=0;
	int result = 0;
	for(int i=0;i<N;i++)
	{
		pv 	=  v;
		cin >> v;
		if(pv==v)
		{
			result++1;
			v=0;
		}
/*
		if(a[cp]!=a[cp+1])
		{
			cp++;
			continue;
		}
		result++;
		a[cp+1]=0;
		if(cp==N-2)				break;
		if(a[cp+1]==a[cp+2])	cp++;
		cp++;
*/
	}
	cout << result << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:33: error: expected ';' before numeric constant
   15 |                         result++1;
      |                                 ^
      |                                 ;
Language: C++

#include<iostream>
using namespace std;
int main()
{
	int N;
	cin >> N;
	int a[N];
	for(int i=0;i<N;i++)
		cin >> a[i];
	int result = 0;
	for(int cp=0;icp<N-1;cp++)
	{
		if(a[cp]!=a[cp+1])
			continue;
		result++;
		a[cp+1]=0;
		if(cp==N-2)				break;
		if(a[cp+1]==a[cp+2])	cp+=1;
	}
	cout << result << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: 'icp' was not declared in this scope; did you mean 'cp'?
   11 |         for(int cp=0;icp<N-1;cp++)
      |                      ^~~
      |                      cp
Language: C++

#include<iotream>
using namespace std;
int main()
{
int n,x=0;
cin>>n;
int a[n];
for(int i=0;i<n;i++)cin>>a[i];
  for(int j=1;j<n-1;j++){
    if(a[j]==a[j-1])
  {x++;j++;}}
cout<<x;
}

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

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

    char inputArray[256];
    int slimeArray[100];
    int slimeNum;
    int changeCount;
void loadData(){
    int af = scanf("%d", &slimeNum);
    int bf = fgets(inputArray,256,stdin);
 //   printf("入力 %s\n",inputArray);
    char w[10];
    int i,j,k;

    j=0;
    k=0;
    for(i=0;inputArray[i]!='\0';i++){
        if(inputArray[i]==' '){
        w[j]='\0';
        slimeArray[k++]=atoi(w);
        j=0;
        }
        w[j++]=inputArray[i];
    }
        w[j]='\0';
        slimeArray[k++]=atoi(w);

    //for(i=0;i<k;i++)printf("%d\n",slimeArray[i]);
    slimeNum = k;

}
int checkColor(int i){
    return slimeArray[i-1] - slimeArray[i];
}
void checkArray(){
    for(int i = 1;i < slimeNum;i++){
        if(checkColor(i)==0){
            slimeArray[i]+=2;
            if(checkColor(i+1)==0)
            slimeArray[i]++;
            changeCount++;
        }
    }

}


int main(void){
    loadData();
    checkArray();
 /*   for(int i = 0;i < slimeNum;i++){
        printf("color : %d\n",slimeArray[i]);
    }*/
    
    printf("%d\n",changeCount);


}

Compiler output:
a.cc: In function 'void loadData()':
a.cc:10:19: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   10 |     int bf = fgets(inputArray,256,stdin);
      |              ~~~~~^~~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   char*