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

#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define FT first
#define SC second
#define MP make_pair
#define PB push_back

using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pint;
const int INF = 1e9;
const double EPS = 1e-9;


int main()
{
  int n ;
  cin >> n ;
  vector<int> hei(n+1) ;
  hei.at(i) = 0 ;
  REP(i,n){
    cin >> hei.at(i+1) ;
  }
  
  FOR(i,1,n){
    if(hei.at(i)>hei.at(i-1)){
      hei.at(i)-- ;
    }
    if(hei.at(i)<hei.at(i+1)){
      cout <<"No"<<endl ;
      return 0 ;
    }
  }
  
  cout <<"Yes"<<endl ;


  return 0 ;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:28:10: error: 'i' was not declared in this scope
   28 |   hei.at(i) = 0 ;
      |          ^
Language: C++

#include <iostream>
using namespace std;
int main()
{
    int n,minim=INT_MAX;
    cin >> n;
    int a[n+1];
    bool ok=true;
    for (int i=1;i<=n;i++)
    {
        cin >> a[i];
    }
    for (int i=n;i>=1;i--)
    {
        minim=min(minim,a[i]);
        if (a[i]-minim>=2) ok=false;
    }
    if (ok) cout << "Yes";
    else cout << "No";
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  int H[N];
  for (int i=0;i<N;i++){
    cin >> H[i];
  }
  bool ans=true;
  for (int i=1;i<n;i++){
    if (H[i-1]==H[i]){
      continue;
    }
    if (H[i-1]+1=H[i]){
      H[i]--;
    }
    else {
      ans=false;
      break;
    }
  }
  if (ans){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: 'n' was not declared in this scope
   12 |   for (int i=1;i<n;i++){
      |                  ^
a.cc:16:15: error: lvalue required as left operand of assignment
   16 |     if (H[i-1]+1=H[i]){
      |         ~~~~~~^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  int H[N];
  for (int I=0;i<N;i++){
    cin >> H[i];
  }
  bool ans=true;
  for (int i=1:i<n;i++){
    if (H[i-1]==H[i]){
      continue;
    }
    if (H[i-1]+1=H[i]){
      H[i]--;
    }
    else {
      ans=false;
      break;
    }
  }
  if (ans){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 'i' was not declared in this scope
    8 |   for (int I=0;i<N;i++){
      |                ^
a.cc:12:13: error: initializer in range-based 'for' loop
   12 |   for (int i=1:i<n;i++){
      |             ^
a.cc:12:18: error: 'n' was not declared in this scope
   12 |   for (int i=1:i<n;i++){
      |                  ^
a.cc:12:19: error: expected ')' before ';' token
   12 |   for (int i=1:i<n;i++){
      |       ~           ^
      |                   )
a.cc:12:20: error: 'i' was not declared in this scope
   12 |   for (int i=1:i<n;i++){
      |                    ^
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];
  for(int i=0;i<N-1;i++)
  {
   if(a[i]<=a[i+1] && a[i+1]-a[i]>1)
   {
     flag=1;
     break;
   }
     
  }
  if(flag==1)
    cout<<"No"<<endl;
  else
    cout<<"Yes"<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:6: error: 'flag' was not declared in this scope
   14 |      flag=1;
      |      ^~~~
a.cc:19:6: error: 'flag' was not declared in this scope
   19 |   if(flag==1)
      |      ^~~~
Language: C++

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

int main() {
    int n;
    cin >> n;
    int h[n];
    bool flg = true;
    int max = 0;
    for(int i=0;i<n;i++){
        cin >> h[i];
        if(h[i] > max) max = h[i];
        if(max - h[i] > 1) flg = false;
    }
    if(flg){
        cout << "Yes";
        return;
    }
     cout << "No";
}

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

n = int(input())
h = [int(x) for x in input().split(' ')]
m = max(h)

for i in range(0, n):
    if m - h[i] > 1:
        print('No')
        exit()
print('Yes')

Compiler output:
a.cc:7:15: warning: multi-character character constant [-Wmultichar]
    7 |         print('No')
      |               ^~~~
a.cc:9:7: warning: multi-character character constant [-Wmultichar]
    9 | print('Yes')
      |       ^~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
      	scanner.nextLine();
      	int[] wall = new int[n];
      	for(int i = 0 ; i < n ; i++ ) {
          wall[i] = scanner.nextInt();
        }

      	int currentHeight = wall[n-1];
      	for(int i = 1 ; i < n ; i++ ) {
          if ( wall[n - i - 1] <= currentHeight ) {
            currentHeight = wall[n - i - 1];
          }
          else if ( wall[n - i - 1] + 1 == currentHeight ) {
          }
          else {
            System.out.println("No");
            return;
          }
        }
      	System.out.println("Yes");
	}
}

Compiler output:
Main.java:7: error: cannot find symbol
      	scanner.nextLine();
      	^
  symbol:   variable scanner
  location: class Main
Main.java:10: error: cannot find symbol
          wall[i] = scanner.nextInt();
                    ^
  symbol:   variable scanner
  location: class Main
2 errors
Language: C++

#include<bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define PB push_back
using namespace std;
typedef pair<int, int> P1;
typedef pair<int, pair<int, int> > P2;
static const int INF = 1ll<<60;
static const int dx[] = { 1, -1, 0, 0, };
static const int dy[] = { 0, 0, 1, -1 };
static const int mod = 1000000007;

int N;
int H[100005];

bool preeq=false;
bool ok=true;

signed main(){
    cin>>N;
    for(int i=0;i<N;++i)cin>>H[i];
    for(int i=0;i<N-1;++i){
        if(H[i]>H[i+1]+1){
            ok=false;
            break;
        }
        else if(preeq&&H[i]==H[i+1]+1){
            ok=false;
            break;
        }
        else if(H[i]==H[i+1]+1){
            H[i]--;
            preeq=true;
        }
        else if(H[i]==H[i+1]){
            preeq=true;
        }
        else if(H[i]<H[i+1])preeq=false;
        else preeq=false
    }
    if(ok)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:25: error: expected ';' before '}' token
   40 |         else preeq=false
      |                         ^
      |                         ;
   41 |     }
      |     ~
Language: C++

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

int N,arr[pow(10,5)];
int main(){
  cin >> N;
  for (int i=0; i<N; i++){
    cin >> arr[i];
  }
  int greatest=arr[0];
  for (int i=1; i<N; i++){
    if (arr[i] > greatest){
      greatest = arr[i];
    }
    else if (arr[i] < greatest-1){
      cout << "No";
      return 0; //terminate
    }
  }
  cout << "Yes";
  return 0;
}

Compiler output:
a.cc:4:14: error: conversion from '__gnu_cxx::__promote<double>::__type' {aka 'double'} to 'long unsigned int' in a converted constant expression
    4 | int N,arr[pow(10,5)];
      |           ~~~^~~~~~
a.cc:4:14: error: could not convert 'std::pow<int, int>(10, 5)' from '__gnu_cxx::__promote<double>::__type' {aka 'double'} to 'long unsigned int'
    4 | int N,arr[pow(10,5)];
      |           ~~~^~~~~~
      |              |
      |              __gnu_cxx::__promote<double>::__type {aka double}
a.cc:4:14: error: size of array 'arr' has non-integral type '__gnu_cxx::__promote<double>::__type' {aka 'double'}
Language: C++

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

int main() {
  int n;
  cin>>n;
  vector<int>h(n);
  rep(i,n) cin>>v[i];
  v[0]--;
  bool flag=true;
  
  for(int i=0; i<n-1; ++i){
    if(v[i]<v[i+1]) {
      v[i+1]--;
      if(v[i]<v[i+1]){
        cout << "No" << endl;
        flag=false;
        break;
      }
    }else{
      cout << "No" << endl;
        flag=false;
        break;
    }
  }
  if(flag==true) cout << "Yes" << endl;
}
        
    


Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'v' was not declared in this scope
    9 |   rep(i,n) cin>>v[i];
      |                 ^
a.cc:10:3: error: 'v' was not declared in this scope
   10 |   v[0]--;
      |   ^
Language: C++

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

int main() {
  int n;
  cin>>n;
  vector<int>h(n);
  rep(i,n) cin>>h[i];
  v[0]--;
  bool flag=true;
  
  for(int i=0; i<n-1; ++i){
    if(v[i]<v[i+1]) {
      v[i+1]--;
      if(v[i]<v[i+1]){
        cout << "No" << endl;
        flag=false;
        break;
      }
    }else{
      cout << "No" << endl;
        flag=false;
        break;
    }
  }
  if(flag==true) cout << "Yes" << endl;
}
        
    

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'v' was not declared in this scope
   10 |   v[0]--;
      |   ^
Language: C++

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

int main() {
  int n; cin>>n;
  vector<int>v(n);
  rep(i,n) cin >> v[i];
  bool flag=true;
  
  for(int i=0; i<n-1; ++i){
    if(v[i]<v[i+1]){
      v[i+1]--;
    }else(v[i]>v[i+1]+1){
      cout << "No" << endl;
      flag=false;
      break;
    }
  } 
  if(flag==true) {
    cout << "Yes" << endl;
  }

}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:15:25: error: expected ';' before '{' token
   15 |     }else(v[i]>v[i+1]+1){
      |                         ^
      |                         ;
Language: C

int main(){
	int i,n=0,m;
	for(i=0;i<=100000;i++)
		scanf("%d", &m);
		if(m-n>1){
			break;
		}
		n=m;
	}
	if(i==100000){
		printf("Yes");
	}else{
		printf("No");
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |                 scanf("%d", &m);
      |                 ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:4:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |                 scanf("%d", &m);
      |                 ^~~~~
main.c:4:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:25: error: break statement not within loop or switch
    6 |                         break;
      |                         ^~~~~
main.c: At top level:
main.c:10:9: error: expected identifier or '(' before 'if'
   10 |         if(i==100000){
      |         ^~
main.c:12:10: error: expected identifier or '(' before 'else'
   12 |         }else{
      |          ^~~~
main.c:15:9: error: expected identifier or '(' before 'return'
   15 |         return 0;
      |         ^~~~~~
main.c:16:1: error: expected identifier or '(' before '}' token
   16 | }
      | ^
Language: C++

#include <iostream>
int main(int argc, char** argv)
{
    int N;
    std::cin >> N;
    std::vector<int> F(N);

    bool ret = true;
    int pre;
    std::cin >> pre;
    int cur;
    for (int i = 1; i < N; i++) {
        std::cin >> cur;
        if (pre < cur) {
            cur--;
        }

        if (pre < cur) {
            ret = false;
            break;
        }
        pre = cur;
    }

    std::cout << ((ret) ? "Yes" : "No") << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:6:10: error: 'vector' is not a member of 'std'
    6 |     std::vector<int> F(N);
      |          ^~~~~~
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 | int main(int argc, char** argv)
a.cc:6:17: error: expected primary-expression before 'int'
    6 |     std::vector<int> F(N);
      |                 ^~~
Language: C++

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

int main(void) {
	long N;
	cin >> N;
	vector<long> H;
	H.resize(N);
	for (int i = 0; i < N; i++) {
		cin >> H[i];
	}

	bool flg = true;
	// abc137_c
#include <iostream>
#include <vector>
using namespace std;

int main(void) {
	long N;
	cin >> N;
	vector<long> H;
	H.resize(N);
	for (int i = 0; i < N; i++) {
		cin >> H[i];
	}

	bool flg = true;
	long min = H[0] - 1;
	for (long i = 1; i < N; i++) {
		if (H[i - 1] > H[i]) {
			if (H[i - 1] - 1 > H[i]) {
				flg = false;
			}
			H[i - 1] -= 1;
			if (H[i - 1] < min) {
				flg = false;
			}
		}
		min = H[i - 1];
	}

	//for (int i = 0; i < N; i++) {
	//	cout << H[i] << " ";
	//}
	//cout << endl;

	if (flg) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

} min = H[0] - 1;
	for (long i = 1; i < N; i++) {
		if (H[i - 1] > H[i]) {
			if (H[i - 1] - 1 > H[i]) {
				flg = false;
			}
			H[i - 1] -= 1;
			if (H[i - 1] < min) {
				flg = false;
			}
		}
		min = H[i - 1];
	}

	//for (int i = 0; i < N; i++) {
	//	cout << H[i] << " ";
	//}
	//cout << endl;

	if (flg) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:16: error: a function-definition is not allowed here before '{' token
   21 | int main(void) {
      |                ^
a.cc:57:16: error: overloaded function with no contextual type information
   57 | } min = H[0] - 1;
      |                ^
a.cc:64:38: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type' {aka 'long int'} and '<unresolved overloaded function type>' to binary 'operator<'
   64 |                         if (H[i - 1] < min) {
a.cc:68:30: error: overloaded function with no contextual type information
   68 |                 min = H[i - 1];
      |                              ^
Language: C++

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

int main(){
long long int N;
cin >>N; long long int M[N];
for(long long int i=0;i<N;i++){
cin >> M[i];
}
if(N==1)cout <<"Yes";
for(long long int i=N-2;i>=0;i--){
   if(M[i]-1==M[i+1]){
      M[i]-=1;
       if(i==0)cout <<"Yes";
      continue;
   } else if(M[i]-1>M[i+1]){
      cout <<"No";
      break;
   }
   if(i==0)cout <<"Yes";
}

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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int length;
  cin >> length ;
  vector<int> number(length);
  for (int i=0;i<length;i++){
    cin >> number.at(i);
  }
  int result=0;
  for (int i=0;i<length-1;i++){
    if(number.at(i)>(number.at(i+1)+1)){
      result=1;
    }else if(number.at(i)==number.at(i+1)+1){
      number.at(i)--
    }
  }
  if (result==0){
    cout << "Yes" << endl;
  }else{
    cout << "No" <<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: expected ';' before '}' token
   15 |       number.at(i)--
      |                     ^
      |                     ;
   16 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>
     
    using namespace std;
     
    int main(){
      int n;
      cin >> n;
      int count = 0;
      int ecount = 0;
      vector<int> h(n);
      for(int i = 0;i < n-1;i++){
        cin >> h[i];
      }
      //int temp = h[0];
      for(int j = 1;j < n;j++){
        if(h[i] > h[i-1]){
          h[i]--;
        }
        if(h[i] > h[i+1]){
          cout << "No" << endl;
          return 0;
        }
      }
      cout << "Yes" << endl;
      return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: 'i' was not declared in this scope
   16 |         if(h[i] > h[i-1]){
      |              ^
a.cc:19:14: error: 'i' was not declared in this scope
   19 |         if(h[i] > h[i+1]){
      |              ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main(){
  int n;
  cin >> n;
  int count = 0;
  int ecount = 0;
  vector<int> h(n);
  for(int i = 0;i < n;i++){
    cin >> h[i];
  }
  int temp = h[0];
  for(int j = 1;j < n;j++){
    if((temp - h[j]) > 1){
      cout << "No"<< endl;
      return 0;
    }
    else if(temp > h[j]){
      //h[j]++;
      count++;
      ecount = 0;
    }
    else if(temp == h[j]){
      ecount++;
      if(ecount > 1){
        ecount = 0:
      }
      count = 0;
    }
    else{
      ecount = 0;
      count = 0;
    }
    if(count + ecount > 1){
      cout << "No"<< endl;
      return 0;
    }
    temp = h[j];
  }
  cout << "Yes" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:19: error: expected ';' before ':' token
   28 |         ecount = 0:
      |                   ^
      |                   ;
Language: Java

public class Main {

	public static void main(String[] args) {
       
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int[] array = new int[a];
        for(int i = 0; i < a; i++){
            array[i] = sc.nextInt();
        }
        int i;
        for(i = 0; i < a - 1; i++){
            if(array[i] == array[i + 1]){
                continue;
            }else if(array[i] > (array[i + 1])){
                array[i + 1] += 1;
                if(array[i] > array[i + 1]){
                    System.out.println("No");
                    break;
                }
            }
        }
        if(i == (a -1)){
            System.out.println("Yes");
        }
    }
}


Compiler output:
Main.java:5: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:5: 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;
vector<int> hi(n);
for (int i =0; i<n; i++){
  cin>>hi.at(i);
}
if(n=1){
  cout<<"Yes"<<endl;
}
else{
  int maxhi=hi.at(0);
  for(int j =1;j<n-1;j++){
    if(maxhi-hi.at(j)>1){
      cout<<"No"<<endl;
      break;
    }
    else if(maxhi<hi.at(j)){
      maxhi=hi.at(j)
      if(j=n-1){
        cout<<"Yes"<<endl;
      }
    }
  }
}


  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:21: error: expected ';' before 'if'
   22 |       maxhi=hi.at(j)
      |                     ^
      |                     ;
   23 |       if(j=n-1){
      |       ~~
Language: C++

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

int main(){
int n;
cin>>n;
vector<int> hi(n);
for (int i =0; i<n; i++){
  cin>>hi.at(i);
}
if(n=1){
  cout<<"Yes"<<endl;
}
else{
  int maxhi=hi.at(0);
  for(int j =1;j<n-1;j++){
    if(maxhi-hi.at(j)>1){
      cout<<"No"<<endl;
      break;
    }
    elseif(maxhi<hi.at(j)){
      maxhi=hi.at(j)
      if(j=n-1){
        cout<<"Yes"<<endl;
      }
    }
  }
}


  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'elseif' was not declared in this scope
   21 |     elseif(maxhi<hi.at(j)){
      |     ^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <map>
#include <set>

using namespace std;

long long n;
long long c[500000];

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for (int i = 0; i < n; i++) cin >> c[i];
    for (int i = 1; i < n; i++)
    {
        if (a[i] - 1 >= a[i - 1])
        {
            a[i]--;
        }
    }
    for (int i = 1; i < n; i++)
    {
        if (a[i - 1] > a[i])
        {
            cout << "NO";
            return 0;
        }
    }
    cout << "YES";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:13: error: 'a' was not declared in this scope
   24 |         if (a[i] - 1 >= a[i - 1])
      |             ^
a.cc:31:13: error: 'a' was not declared in this scope
   31 |         if (a[i - 1] > a[i])
      |             ^
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] H = new int[N];
        int rem = 0;
        boolean result = true;
        
        for(int i = 0; i < N; i++){
            H[i] = sc.nextInt();
            if(i == 0)continue;
            if(H[i-1] + 1 > H[i]){
                if(H[i] < rem - 1){
                    result = false;
                    break;
                }
                rem = H[i-1];
            }else if(H[i-1] > H[i]){
                result = false;
                break;
            }
        }
        if(result){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}


Compiler output:
Main.java:7: error: incompatible types: int[] cannot be converted to long[]
        long[] H = new int[N];
                   ^
Main.java:19: error: incompatible types: possible lossy conversion from long to int
                rem = H[i-1];
                       ^
2 errors
Language: C++

#include <stdio.h>
#include <stdbool.h>
#define rep(i,j) for(int i=0;i<j;i++)
bool check(int *start,int *end)
{
	while(start!=end-1){
		if(*start>*(start+1)) return false;
		start++;
	}
	return true;
}
void slove(int *start,int *end)
{
	while(start!=end-1){
		if(*start>*(start+1)) *start=(*start)-1;
		start++;
	}
}
void main(void)
{
	int array[100000];
	int N;
	scanf("%d",&N);
	rep(i,N) scanf("%d",&array[i]);
	slove(array,array+N);
	printf("%s",check(array,array+N)?"Yes":"No");
}


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

N = int(input())
H = list(map(int, input().split()))

for i in range(N-1, 0, -1):
    if H[i-1] - H[i] == 1:
        H[i-1] -= 1
    elif H[i-1] - H[i] > 1:
        flag = False
        print('No')
        break
else:
    print('Yes')


Compiler output:
a.cc:9:15: warning: multi-character character constant [-Wmultichar]
    9 |         print('No')
      |               ^~~~
a.cc:12:11: warning: multi-character character constant [-Wmultichar]
   12 |     print('Yes')
      |           ^~~~~
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int[] h = new int[n];
      for(int i = 0;i < n;i++){
      	h[i] = sc.nextInt();
      }
      int result = 0;
      int[] count = new int[n];
      for(int i = 1;i < n;i++){
      	if(h[i] >= h[i-1]) result++;
        else if(h[i] >= h[i-1]-1 && count[i-1]==0){
          result++;
          count[i]++;
        }
      }
      if(result = n-1)System.out.println("Yes");
      else System.out.println("No");
    }
}

Compiler output:
Main.java:19: error: incompatible types: int cannot be converted to boolean
      if(result = n-1)System.out.println("Yes");
                ^
1 error
Language: C++

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

typedef long long ll;

int main() {
	int n, m, dish;
	cin >> n;
	vector<int> h(n); //配列
	for(int i = 0; i < n; i++){
		cin >> h[i];
	}
	for(int i = 0; i < n - 1; i++){
      　if(i == 0) continue;
		if(h[i-1] > h[i]){
			puts("No");
			return 0;
		}if(h[i-1] < h[i]){
			h[i]--;
		}
    }
    puts("Yes");
    return 0;	
}


Compiler output:
a.cc:16:7: error: extended character 　 is not valid in an identifier
   16 |       　if(i == 0) continue;
      |       ^
a.cc: In function 'int main()':
a.cc:16:7: error: '\U00003000if' was not declared in this scope
   16 |       　if(i == 0) continue;
      |       ^~~~
Language: C++

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

typedef long long ll;

int main() {
	int n, m, dish;
	cin >> n;
	vector<int> h(n); //配列
	for(int i = 0; i < n; i++){
		cin >> h[i];
	}
	for(int i = 0; i < n - 1; i++){
		if(h[i-1] > h[i]){
			puts("No")
			return 0;
		}if(h[i-1] < h[i]){
			h[i]--;
		}
    puts("Yes");
    return 0;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:35: error: expected ';' before 'return'
   17 |                         puts("No")
      |                                   ^
      |                                   ;
   18 |                         return 0;
      |                         ~~~~~~     
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:8:12: note: to match this '{'
    8 | int main() {
      |            ^
Language: C++

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

typedef long long ll;

int main() {
	int n, m, h_max, h_l;
	cin >> n;
	vector<int> h(n); //配列
	for(int i = 0; i < n; i++){
		cin >> h[i];
	}
	for(int i = 1; i < n - 1; i++){
		h_max = max(h[i], h[0]);
		h_l = h[i+1];
		if((h_max - h_l) >= 2){ 
			puts("No");
			exit();
		} 		
	}
    puts("Yes");
    return 0;	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:29: error: too few arguments to function 'void exit(int)'
   20 |                         exit();
      |                         ~~~~^~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:756:13: note: declared here
  756 | extern void exit (int __status) __THROW __attribute__ ((__noreturn__));
      |             ^~~~
Language: C++

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

typedef long long ll;

int main() {
	int n, m, h_max, h_l;
	cin >> n;
	vector<int> h(n); //配列
	for(int i = 0; i < n; i++){
		cin >> h[i];
	}
	for(int i = 1; i < n - 1; i++){
		h_max = max(h[i], h[0]);
		h_l = h[i+1];
		if(h_max - h_l >= 2) puts("No");
		return 0;
		else continue; 		
	}
    puts("Yes");
    return 0;	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'else' without a previous 'if'
   20 |                 else continue;
      |                 ^~~~
Language: C++

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

typedef long long ll;

int main() {
	int n, m, h_max, h_i+1;
	cin >> n;
	vector<int> h(n); //配列
	for(int i = 0; i < n; i++){
		cin >> h[i];
	}
	for(int i = 1; i < n - 1; i++){
		h_max = max(h[i], h[0]);
		h_i+1 = h[i+1];
		if(h_max - h_i+1 >= 2) puts("No");
		return 0;
		else continue; 		
	}
    puts("Yes");
    return 0;	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: expected initializer before '+' token
    9 |         int n, m, h_max, h_i+1;
      |                             ^
a.cc:17:17: error: 'h_i' was not declared in this scope
   17 |                 h_i+1 = h[i+1];
      |                 ^~~
a.cc:20:17: error: 'else' without a previous 'if'
   20 |                 else continue;
      |                 ^~~~
Language: C++

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

typedef long long ll;

int main() {
	int n, m;
	cin >> n;
	/*for(int i = 0; i < n; i++){
		cin >> h[i];
	}*/
	vector<int> h(n); //配列
	for(int i = 0; i < n; i++){
		cin >> h[i];
	}
	for(int i = 0; i < n; i++){
		if(i == 0) continue;
		if(h[i-1] > h[i]){
			--h[i-1];
			if(h[i-1] > h[i]) puts("No");
	}
    puts("Yes");
    return 0;	
}


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

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

int main(){
    int n;
    cin >> n;
    
    string ans = "Yes";
    
    vector<int> h(n);
    for(int i = 0; i < n; i++){
        cin >> h.at(i);
    }
    
    if(h.size() != 1){
        if(h.at(0) > h.at(1) + 1)ans = "No";
        if(h.at(0) == h.at(1) + 1)h.at(0)--;
    }
    
    
    for(int i = 1; i < n - 1; i++){
        if(h.at(i) > h.at(i + 1) + 1 ||
        (h.at(i) == h.at(i + 1) + 1 && h.at(i - 1) == h.at(i))){
                ans = "No";
                break;
        }
        
        if(h.at(i) == h.at(i + 1) + 1){
            if(h.at(i - 1) < h.at(i))h.at(i)--;
            else {
                ans = "No";
                break;
            }
    }
    
    cout << ans << endl;
}

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

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

int main(){
  int a;
  cin>>a;
  int now;
  cin>>now;
  now--;
  for(i=0;i<a-1;i++){
	int num;
    cin>>num;
    if(num<now){
      cout<<"No"<<endl;
      return 0;
    }
    else now=max(now,num-1);
  }
  cout<<"Yes"<<endl;
  return 0;
}




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

import java.util.*;

public class Build_Stairs{
  public static void Main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int h ;
    ArrayList<Integer> list = new ArrayList<Integer>();

    for(int i=0; i<n; i++){
      h = sc.nextInt();
      list.add(h);

    }
    //System.out.println(list);

    for(int j=0; j<n-1; j++){
      if(list.get(j)>list.get(j+1)){
        list.set(j,list.get(j)-1);
        if(j==0 && list.get(j)>list.get(j+1)){
          //処理しても右の方が大きい場合の処理
          System.out.println("No");
          return ;
        }
        if(list.get(j-1)>list.get(j)||list.get(j)>list.get(j+1)){
          System.out.println("No");
          return ;
        }
      }
      //System.out.println(list);
    }
    System.out.println("Yes");
  }
}

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


#include <iostream>
#include<iomanip>
#include <iomanip>
#include <math.h>

void C();
bool subC(int*, int);

int main()
{
	C();
}
void C() {
	int N; cin >> N;
	int* H = new int[N];
	for (int i = 0; i < N; i++) cin >> H[i];

	if (subC(H, N)) cout << "yes" << endl;
	else cout << "no" << endl;

	delete[] H;
}
bool subC(int* H, int len) {
	int tempMax = 0;
	for (int i = 0; i < len - 1; i++) {
		tempMax = fmax(tempMax, H[i]);
		if (tempMax >= H[i + 1] + 2) return false;
	}
	return true;
}


Compiler output:
a.cc: In function 'void C()':
a.cc:15:16: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   15 |         int N; cin >> N;
      |                ^~~
      |                std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:19:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |         if (subC(H, N)) cout << "yes" << endl;
      |                         ^~~~
      |                         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:42: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |         if (subC(H, N)) cout << "yes" << 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)
      |     ^~~~
a.cc:20:14: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |         else cout << "no" << endl;
      |              ^~~~
      |              std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:20:30: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 |         else cout << "no" << endl;
      |                              ^~~~
      |                              std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include "stdafx.h"
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include <cstdint>
#include <utility>
#include <tuple>
#include <map>    
#include <queue> 
#include <set>  
#include <stack> 
#include <deque>  
#include <unordered_map> 
#include <unordered_set> 
#include <bitset>
using namespace std;
int main()
{
		int N;
		cin >> N;
		vector<string> s(N);
		for (int i = 0; i < N; i++) {
			cin >> 	s.at(i);
			sort(s[i].begin(), s[i].end());
		}

		sort(s.begin(), s.end());

		int64_t count = 0;
		int64_t ans = 0;

		for (int i = 0; i < N - 1; i++) {
			if (s.at(i + 1) == s.at(i)) {
				count++;
				ans += count;
			}
			else {
				count = 0;
			}
		}
		cout << ans << endl;
    return 0;
}

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

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

int main() {
  int n;
  cin >> n;
  vector<int> h(n);
  for(int i = 0; i < n; i++)
    cin >> h.at(i);
  reverse(h.begin(), h.end());
  bool b = 1;
  for(int i = 0; i < n-1; i++){
    if(h.at(i) < h.at(i+1)-1){
      b = 0;
      break;
    }
    else if(h.at(i) == h.at(i+1)-1)
      h.at(i+1)--;
  }
  }
  if(b)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Compiler output:
a.cc:21:3: error: expected unqualified-id before 'if'
   21 |   if(b)
      |   ^~
a.cc:23:3: error: expected unqualified-id before 'else'
   23 |   else
      |   ^~~~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

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

typedef long long ll;

int main() {
int n, a;
cin >> n;
vector<int> a(n); 
rep(i, n) {	
	cin >> a[i];
}
int pre = -999; // 最初の比較用の負のでかい数
rep(i, n) {
	if (pre <= a[i] - 1) { //直前の数-1以上ならpreを1減らして更新
		pre = a[i] - 1;
	} else if (pre <= a[i]) {//直前の数以上ならpreを更新
		pre = a[i];	
	} else {//直前の数より小さかったら問答無用でNo
		puts("No");
		return 0;
	}
}
puts("Yes");	
return 0;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: conflicting declaration 'std::vector<int> a'
   11 | vector<int> a(n);
      |             ^
a.cc:9:8: note: previous declaration as 'int a'
    9 | int n, a;
      |        ^
a.cc:13:17: error: invalid types 'int[int]' for array subscript
   13 |         cin >> a[i];
      |                 ^
a.cc:17:21: error: invalid types 'int[int]' for array subscript
   17 |         if (pre <= a[i] - 1) { //直前の数-1以上ならpreを1減らして更新
      |                     ^
a.cc:18:24: error: invalid types 'int[int]' for array subscript
   18 |                 pre = a[i] - 1;
      |                        ^
a.cc:19:28: error: invalid types 'int[int]' for array subscript
   19 |         } else if (pre <= a[i]) {//直前の数以上ならpreを更新
      |                            ^
a.cc:20:24: error: invalid types 'int[int]' for array subscript
   20 |                 pre = a[i];
      |                        ^
Language: C++

int main() {
	int N;
	cin >> N;
	vector<unsigned long> H(N);
	for(int i = 0; i < N; i++){
		cin >> H.at(i);
	}
	bool yes = true;
	int cnt = 0;
	while(1){
		if(cnt != H.size() - 1){
			if(H.at(cnt) <= H.at(cnt + 1)){
				cnt++;
				continue;
			}
			else if(H.at(cnt) - 1 > H.at(cnt + 1)){
				yes = false;
				break;
			}
			else{
				H.at(cnt)--;
				if(cnt >= 1){
					if(H.at(cnt) < H.at(cnt - 1)){
						yes = false;
						break;
					}
					else{
						cnt++;
						continue;
					}
				}
				else{
					cnt++;
					continue;
				}
			}
		}
		else{
			if(cnt >= 1){
				if(H.at(cnt) >= H.at(cnt - 1)){
					break;
				}
				else{
					yes = false;
					break;
				}
			}
			else{
				break;
			}
		}
	}
	if(yes){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> N;
      |         ^~~
a.cc:4:9: error: 'vector' was not declared in this scope
    4 |         vector<unsigned long> H(N);
      |         ^~~~~~
a.cc:4:16: error: expected primary-expression before 'unsigned'
    4 |         vector<unsigned long> H(N);
      |                ^~~~~~~~
a.cc:6:24: error: 'H' was not declared in this scope
    6 |                 cin >> H.at(i);
      |                        ^
a.cc:11:27: error: 'H' was not declared in this scope
   11 |                 if(cnt != H.size() - 1){
      |                           ^
a.cc:54:17: error: 'cout' was not declared in this scope
   54 |                 cout << "Yes" << endl;
      |                 ^~~~
a.cc:54:34: error: 'endl' was not declared in this scope
   54 |                 cout << "Yes" << endl;
      |                                  ^~~~
a.cc:57:17: error: 'cout' was not declared in this scope
   57 |                 cout << "No" << endl;
      |                 ^~~~
a.cc:57:33: error: 'endl' was not declared in this scope
   57 |                 cout << "No" << endl;
      |                                 ^~~~
Language: C++

#include <iostream>
using namespace std;
 
int main(){
	ios_base::sync_with_stdio(0);
 	
    int n;
    cin >> n;

    if(n>1){
    	bool cont=1;
	    ll arr[n+10];
	    bool once=false;

	    for(int i=0;i<n;i++){
	    	cin >> arr[i];

	    	if(i>0){
	    		if(arr[i-1]>arr[i]){
	    			if(arr[i-1]-1<=arr[i] && once==false){
	    				once=true;
	    				continue;
	    			}
	    			else{
	    				cout << "No\n";
	    				cont=false;
	    				break;
	    			}
	    		}
	    	}
	    }

	    if(cont){
	    	cout << "Yes\n";
	    }
	}
	else{
		cout << "Yes\n";
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: 'll' was not declared in this scope
   12 |             ll arr[n+10];
      |             ^~
a.cc:16:24: error: 'arr' was not declared in this scope
   16 |                 cin >> arr[i];
      |                        ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <map>
#include <sstream>
#include <conio.h>
#define ll long long
using namespace std;
 
int main(){
	ios_base::sync_with_stdio(0);
 	
    int n;
    cin >> n;

    if(n>1){
    	bool cont=1;
	    int arr[n+10];
	    bool once=false;

	    for(int i=0;i<n;i++){
	    	cin >> arr[i];

	    	if(i>0){
	    		if(arr[i-1]>arr[i]){
	    			if(arr[i-1]-1<=arr[i] && once==false){
	    				once=true;
	    				continue;
	    			}
	    			else{
	    				cout << "No\n";
	    				cont=false;
	    				break;
	    			}
	    		}
	    	}
	    }

	    if(cont){
	    	cout << "Yes\n";
	    }
	}
	else{
		cout << "Yes\n";
	}
}

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

#include <stdio.h>
int main(void)
{
	int n, h[100002], a, b = 0;
	h[100002] = 10^9
	
    scanf("%d", &n);
	for(a = 1; a <= n; a++){
		scanf("%d", &h[a]);
	}
	
	for(a = 1; a < n; a++){
		if(h[a] >= h[a + 1] + 2){
			b++;
		}
		if(h[a] == h[a + 1] + 1 && h[a + 1] == h[a + 2] + 1){
			b++;
		}
	}
	
	if(b > 0){
		printf("No");
	}else{
		printf("Yes");
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:23: warning: result of '10^9' is 3; did you mean '1e9'? [-Wxor-used-as-pow]
    5 |         h[100002] = 10^9
      |                       ^
      |                     ---
      |                     1e
main.c:5:21: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
    5 |         h[100002] = 10^9
      |                     ^~
      |                     0xa
main.c:5:25: error: expected ';' before 'scanf'
    5 |         h[100002] = 10^9
      |                         ^
      |                         ;
    6 | 
    7 |     scanf("%d", &n);
      |     ~~~~~
Language: C++

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

typedef struct stair{
    int hgt;
    int dis;
}part;

void initstr(char str[]){
    for(int i=0;str[i]!='\0';i++){
        str[i]=0;
    }
}

void extIntStr(char str[],int data[]){
    int k,j,i;
    i=k=j=0;
    char buf[11];
    str[strlen(str)]=' ';
    for(i=0;str[i]!='\0';i++){
        if(str[i]==' '||str[i]=='\0'){
            data[k]=atoi(buf);
            k++;
            j=0;
            initstr(buf);
        }else{
            buf[j++]=str[i];
        }
    }
}

int main(){
    int N,M,i,t,j;
    scanf("%d ",&N);
    part *data;
    data = (part*)malloc(N*sizeof(part));
    int *itmp;
    itmp=(int*)malloc(N*sizeof(int));
    char *get;
    char buf[6];
    get=(char*)malloc(N*sizeof(char)*5+1);
    gets(get);
    printf("%s\n",get);
    extIntStr(get,itmp);
    for(i=0;i<N;i++){
        data[i].hgt=itmp[i];
        printf("%d\n",data[i].hgt);
    }
    for(i=0;i<N-1;i++){
        data[i].dis=data[i+1].hgt-data[i].hgt;
    }
    t=0;
    int flag=0;
    for(i=0;i<N-1;i++){
        if(data[i].dis<-1)flag=1;
        if(data[i].dis==-1)t++;
    }
    if(t>1)flag=1;
    if(flag)printf("No");
    else printf("Yes");
    free(data);
    return 0;
}

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

int main(){
  int n, ans = 0;
  cin >> n;
  vector<int> enter(n);
  rep(i, n) cin >> enter[i];
  
  for(int i = n-1; i > 0; i--){
    if(enter[i-1] - enter[i] > 1){
      ans = 1;
      break;
    }
    else if(enter[i-1] - enter[i] == 1) enter[i-1] -= 1;
  }
  
  if(ans == 1) cout << "No" << endl;
  else cout << "Yes" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> n;
      |   ^~~
a.cc:4:3: error: 'vector' was not declared in this scope
    4 |   vector<int> enter(n);
      |   ^~~~~~
a.cc:4:10: error: expected primary-expression before 'int'
    4 |   vector<int> enter(n);
      |          ^~~
a.cc:5:7: error: 'i' was not declared in this scope
    5 |   rep(i, n) cin >> enter[i];
      |       ^
a.cc:5:3: error: 'rep' was not declared in this scope
    5 |   rep(i, n) cin >> enter[i];
      |   ^~~
a.cc:8:8: error: 'enter' was not declared in this scope; did you mean 'extern'?
    8 |     if(enter[i-1] - enter[i] > 1){
      |        ^~~~~
      |        extern
a.cc:15:16: error: 'cout' was not declared in this scope
   15 |   if(ans == 1) cout << "No" << endl;
      |                ^~~~
a.cc:15:32: error: 'endl' was not declared in this scope
   15 |   if(ans == 1) cout << "No" << endl;
      |                                ^~~~
a.cc:16:8: error: 'cout' was not declared in this scope
   16 |   else cout << "Yes" << endl;
      |        ^~~~
a.cc:16:25: error: 'endl' was not declared in this scope
   16 |   else cout << "Yes" << endl;
      |                         ^~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> data(N);
  for (int i = 0; i < N; i++) {
    cin >> data.at(i);
  }
  ll int low = (ll)data.at(0);
  rep(i,N){
    if(low > data.at(i) - 1){
      cout << No < endl;
      return 0;
    }else if(low == data.at(i) - 1){
      #nothing.do
    }else{
      low = (ll)data.at(i);
    }
  }
  cout << Yes <, endl;
  return 0;
}


Compiler output:
a.cc:2:2: error: invalid preprocessing directive #rep
    2 | #rep(i,n) for(int i = 0; i < (n); ++i)
      |  ^~~
a.cc:18:8: error: invalid preprocessing directive #nothing
   18 |       #nothing.do
      |        ^~~~~~~
a.cc: In function 'int main()':
a.cc:12:3: error: 'll' was not declared in this scope
   12 |   ll int low = (ll)data.at(0);
      |   ^~
a.cc:13:7: error: 'i' was not declared in this scope
   13 |   rep(i,N){
      |       ^
a.cc:13:3: error: 'rep' was not declared in this scope
   13 |   rep(i,N){
      |   ^~~
a.cc:23:11: error: 'Yes' was not declared in this scope
   23 |   cout << Yes <, endl;
      |           ^~~
a.cc:23:16: error: expected primary-expression before ',' token
   23 |   cout << Yes <, endl;
      |                ^
Language: C++

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n =sc.nextInt();
		int[] h = new int[100000001];
		boolean flag=false;
		for(int i=0;i<n;i++) {
			h[i]=sc.nextInt();
			if( i!=0 && h[i]>h[i-1] ) { //単調減少列が作れるかになっていた
					h[i]--;
			}
		}
		for(int i=0;i<n;i++) {
			if(i!=0 && h[i]<h[i-1]) {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}
}


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

#include <iostream>
#include <vector>
#inclued <algorithm>

auto main() -> int
{
   int num = 0;
   std::cin >> num;

   std::vector<int> nums;
   while (num --> 0) nums.emplace_back(std::cin.get());

   auto p = std::minmax(nums.begin(), nums.end());

   if (*p.first > *p.second + 1 && p.first < p.second)
      std::cout << "False";
   else
      std::cout << "True";
}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inclued; did you mean #include?
    3 | #inclued <algorithm>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:13:18: error: 'minmax' is not a member of 'std'
   13 |    auto p = std::minmax(nums.begin(), nums.end());
      |                  ^~~~~~
Language: C++

#include <iostream>
#include <vector>
#inclued <algorithm>

auto main() -> int
{
   int num = 0;
   std::cin >> num;
   
   std::vector<int> nums;
   while (num --> 0) nums.emplace_back(cin.get());

   auto p = std::minmax(nums.begin(), nums.end());
   
   if (*p.first > *p.second + 1 && p.first < p.second)
      std::cout << "False";
   else
      std::cout << "True";
}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inclued; did you mean #include?
    3 | #inclued <algorithm>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:11:40: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   11 |    while (num --> 0) nums.emplace_back(cin.get());
      |                                        ^~~
      |                                        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:13:18: error: 'minmax' is not a member of 'std'
   13 |    auto p = std::minmax(nums.begin(), nums.end());
      |                  ^~~~~~