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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll n, a;
  in(n);
  vector<ll> c(n);
  rep(i, n)
    in(c[i]);
  rep(i, n - 1ll){
    if(a[i] - 1ll == a[i + 1ll])
      a[i + 1ll]++;
    else if(a[i] - 1ll > a[i + 1ll]){
      cout << "No";
      break;
    }
    if(i == n - 1ll)
      out("Yes");
  }
  memi;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   24 |     if(a[i] - 1ll == a[i + 1ll])
      |         ^
a.cc:24:23: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   24 |     if(a[i] - 1ll == a[i + 1ll])
      |                       ^
a.cc:25:8: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   25 |       a[i + 1ll]++;
      |        ^
a.cc:26:14: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   26 |     else if(a[i] - 1ll > a[i + 1ll]){
      |              ^
a.cc:26:27: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   26 |     else if(a[i] - 1ll > a[i + 1ll]){
      |                           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll n, a;
  in(n);
  vector<ll> c(n);
  rep(i, n)
    in(c[i]);
  rep(i, n - 1){
    if(a[i] - 1 == a[i + 1])
      a[i + 1]++;
    else if(a[i] - 1 > a[i + 1]){
      cout << "No";
      break;
    }
    if(i == n - 1)
      out("Yes");
  }
  memi;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   24 |     if(a[i] - 1 == a[i + 1])
      |         ^
a.cc:24:21: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   24 |     if(a[i] - 1 == a[i + 1])
      |                     ^
a.cc:25:8: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   25 |       a[i + 1]++;
      |        ^
a.cc:26:14: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   26 |     else if(a[i] - 1 > a[i + 1]){
      |              ^
a.cc:26:25: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   26 |     else if(a[i] - 1 > a[i + 1]){
      |                         ^
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 M[] =new int[N];
    for(int i=0;i<N;i++){
      M[i]=sc.nextINt();}
   int L =M[N-1]+1;
    for(int j=0;j<N;j++){
      L = Math.max(L,M[N-j]);
      if(L==M[N-j]){System.out.println("No");}
    }
    System.out.println("Yes");
  }
}

Compiler output:
Main.java:8: error: cannot find symbol
      M[i]=sc.nextINt();}
             ^
  symbol:   method nextINt()
  location: variable sc of type Scanner
1 error
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 M[] =new int[N];
    if(N==1){System.out.println("Yes");}else{
    M[0]=sc.nextInt();
    int s =0;
    for(int i=1;i<N;i++){
      M[i]=sc.nextInt();
      int L =M[0];
      L = Math.max(L,M[i]);}
      if(L-1>M[i]){break;}
      s=s+1;}
      if(s==N-1){System.out.println("Yes");}else{System.out.println("No");}
  }
}


Compiler output:
Main.java:14: error: cannot find symbol
      if(L-1>M[i]){break;}
         ^
  symbol:   variable L
  location: class Main
Main.java:14: error: cannot find symbol
      if(L-1>M[i]){break;}
               ^
  symbol:   variable i
  location: class Main
Main.java:14: error: break outside switch or loop
      if(L-1>M[i]){break;}
                   ^
Main.java:16: error: cannot find symbol
      if(s==N-1){System.out.println("Yes");}else{System.out.println("No");}
         ^
  symbol:   variable s
  location: class Main
4 errors
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 M[] =new int[N];
    if(N==1){System.out.println("Yes");}else{
    M[0]=sc.nextInt();
    int s =0;
    for(int i=1;i<N;i++){
      M[i]=sc.nextInt();
      int L =M[0];
      L = Math.max(L,M[i]);}
      if(L-1>M[i]){break;}
      s=s+1;}
      if(s==N-1){System.out.println("Yes");}else{System.out.println("No");}
    }
  }
}


Compiler output:
Main.java:19: error: class, interface, enum, or record expected
}
^
1 error
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 M[] =new int[N];
    if(N==1){System.out.println("Yes");}else{
    M[0]=sc.nextInt();
    int s =0;
    for(int i=1;i<N;i++){
      M[i]=sc.nextInt();
         for(int j =0;j<i;j++){
           L = Math.max(L,M[j]);}
      if(L-1>M[i]){break;}
      s=s+1;}
      if(s==N-1){System.out.println("Yes");}else{System.out.println("No");}
    }
  }
}


Compiler output:
Main.java:13: error: cannot find symbol
           L = Math.max(L,M[j]);}
           ^
  symbol:   variable L
  location: class Main
Main.java:13: error: cannot find symbol
           L = Math.max(L,M[j]);}
                        ^
  symbol:   variable L
  location: class Main
Main.java:14: error: cannot find symbol
      if(L-1>M[i]){break;}
         ^
  symbol:   variable L
  location: class Main
3 errors
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 M[] =new int[N];
    if(N==1){System.out.println("Yes");}else{
    M[0]=sc.nextInt();
    int s =0;
    for(int i=1;i<N;i++){
      M[i]=sc.nextInt();
    if(M[i-1]-1>M[i]){break;}
         int L=M[0];
         for(int j =0;j<i;j++){
           L = Math.max(L,M[j]);}
      if(L-1>M[i]){break;}
      s=s+1;}
      if(s==N-1){System.out.println("Yes");}else{System.out.println("No");}
    }}
  }
}


Compiler output:
Main.java:21: error: class, interface, enum, or record expected
}
^
1 error
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 M[] =new int[N];
    if(N==1){System.out.println("Yes");}else{
    M[0]=sc.nextInt();
    M[1]=sc.nextInt();
    if(M[0]-1>M[1]){System.out.println("No");}else{
    int s =1;
    for(int i=2;i<N;i++){
      M[i]=sc.nextInt();
    if(M[i-1]-1>M[i]){break;}
         int L=M[0];
         for(int j =0;j<i;j++){
           L = Math.max(L,M[j]);}
      if(L-1>M[i]){break;}
      s=s+1;}
      if(s==N-1){System.out.println("Yes");}else{System.out.println("No");}
    }
  }
}


Compiler output:
Main.java:23: error: reached end of file while parsing
}
 ^
1 error
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 M[] =new int[N];
    if(N==1){System.out.println("Yes");}else{
    M[0]=sc.nextInt();
    M[1]=sc.nextInt();
    if(M[0]-1>M[1]){System.out.println("No");}
    else if(N==2){System.out.println("Yes");}else{
    int s =1;
    for(int i=2;i<N;i++){
      M[i]=sc.nextInt();
    if(((M[i-1]-1>M[i])||((M[i-2]-1==M[i-1])&&
                        (M[i-1]-1==M[i]))){break;}
         int L=M[0];
         for(int j =0;j<i;j++){
           L = Math.max(L,M[j]);}
      if(L-1>M[i]){break;}
      s=s+1;}
      if(s==N-1){System.out.println("Yes");}else{System.out.println("No");}
    }}
  }
}


Compiler output:
Main.java:16: error: ')' expected
                        (M[i-1]-1==M[i]))){break;}
                                          ^
1 error
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 M[] =new int[];
    M[0]=sc.nextInt();
    M[1]=sc.nextInt();
    if(M[0]-1>M[1]){System.out.println("No");}
    else{
    int s =1
    for(int i=2;i<N;i++){
      M[i]=sc.nextInt();
    if((M[i-1]-1>M[i])||(M[i-2]-2==M[i])){break;}
      s=s+1;}
      if(s==N){System.out.println("Yes");}else{System.out.println("No");}
    }
  }
}

Compiler output:
Main.java:6: error: array dimension missing
    int M[] =new int[];
                      ^
Main.java:11: error: ';' expected
    int s =1
            ^
2 errors
Language: C

#include<stdio.h>
char check(int H[],int n,i){
    H[i] += 1;
    for(int j = 0 ; j < N-1 ; j++){
        if(H[j] > H[j+1])
            return 0;
    }
    flag = 1;
    return "YES";
}
int main(){
    int N,i;
    int H[100000];
    
    scanf("%d",&N);
    for(i = 0 ; i < N ; i++){
        scanf("%d",&H[i]);
    }
    
    for(i = 0 ; i < N ; i++){
        check(H,N,i);
    }
}


Compiler output:
main.c:2:26: error: unknown type name 'i'
    2 | char check(int H[],int n,i){
      |                          ^
main.c: In function 'main':
main.c:21:9: error: implicit declaration of function 'check' [-Wimplicit-function-declaration]
   21 |         check(H,N,i);
      |         ^~~~~
Language: C++

#include <iostream>
#include<bits/stdc++.h>
using namespace std;
 
 const int N=10E5+2
 long long int arr[N];
 
int main() {

 
long long int n;
cin>>n;

int maxi=0;
for(int i=0;i<n;i++){cin>>arr[i];}
long long int temp=arr[0];
for(int i=0;i+1<n;i++){
 
 
    if(temp>arr[i+1])
 
        {
            if(arr[i+1]-temp!=-1){cout<<"No"; return 0;}
                     else arr[i]--;
 
            }
 
 temp=arr[i];
}
 
 
cout<<"Yes";
}
 

Compiler output:
a.cc:6:2: error: expected ',' or ';' before 'long'
    6 |  long long int arr[N];
      |  ^~~~
a.cc: In function 'int main()':
a.cc:15:27: error: 'arr' was not declared in this scope
   15 | for(int i=0;i<n;i++){cin>>arr[i];}
      |                           ^~~
a.cc:16:20: error: 'arr' was not declared in this scope
   16 | long long int temp=arr[0];
      |                    ^~~
Language: C++

#include <iostream>
#include<bits/stdc++.h>
using namespace std;
 
 const int N=10E5+2
 long long int arr[N];
 
int main() {

 
long long int n;
cin>>n;

int maxi=0;
for(int i=0;i<n;i++){cin>>arr[i];}
long long int temp=arr[0];
for(int i=0;i+1<n;i++){
 
 
    if(temp>arr[i+1])
 
        {
            if(arr[i+1]-temp!=-1){cout<<"No"; return 0;}
                     else arr[i]--;
 
            }
 
 temp=arr[i];
}
 
 
cout<<"Yes";
 
 
}

Compiler output:
a.cc:6:2: error: expected ',' or ';' before 'long'
    6 |  long long int arr[N];
      |  ^~~~
a.cc: In function 'int main()':
a.cc:15:27: error: 'arr' was not declared in this scope
   15 | for(int i=0;i<n;i++){cin>>arr[i];}
      |                           ^~~
a.cc:16:20: error: 'arr' was not declared in this scope
   16 | long long int temp=arr[0];
      |                    ^~~
Language: Java

import java.util.*;

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

        int N = sc.nextInt();
        int[] H = new int[N];

        for(int i=0; i<N; i++){
            H[i] = sc.nextInt();
        }
        if(N==1){
            System.out.println("Yes");
        }
        else if(N>1){
            if(H[0]-H[1]==1){
                H[0] -= 1;
            }
            
            for(int i=0; i<N-1; i++){
                if(i==0 && H[i]-H[i+1]>1){
                    System.out.println("No");
                    break;
                }
                else if(i==0){
                    continue;
                }

                if(H[i]-H[i+1]>1){
                    System.out.println("No");
                    break;
                }
                else if(H[i]-H[i+1]==1 && H[i]>H[i-1]){
                    H[i] -= 1;
                }
                else if(H[i]-H[i+1]==1 && H[i]=<H[i-1]){
                    System.out.println("No");
                    break;
                }

                if(i==N-2){
                    System.out.println("Yes");
                }
            }
        }
    }
}

Compiler output:
Main.java:37: error: ']' expected
                else if(H[i]-H[i+1]==1 && H[i]=<H[i-1]){
                                                  ^
Main.java:37: error: not a statement
                else if(H[i]-H[i+1]==1 && H[i]=<H[i-1]){
                                                   ^
Main.java:37: error: ';' expected
                else if(H[i]-H[i+1]==1 && H[i]=<H[i-1]){
                                                     ^
3 errors
Language: Java

package cpc;

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

public class BuildStairs {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] hs = br.readLine().split(" ");
		int[] he = new int[n];			
		for (int i = 0; i < n; i++) {
			he[i] = Integer.parseInt(hs[i]);
		}
		int max = he[0];
		boolean stop = false;
		for (int i = 0; i < n-1 && !stop; i++) {
			if(max < he[i]) {
				max=he[i];
			}
			if(he[i] <= he[i+1]) {
				if(max == he[i]) {
					max--;
				}
				he[i]--;
			} else {
				if(he[i] - 1 > he[i+1] || he[i] < max) {
					stop = true;
					System.out.println("No");
				} else {
					he[i]--;
					if(max == he[i]) {
						max--;
					}
				}
			}
			//System.out.println(Arrays.toString(he));
			//System.out.println(max);
		}
		if(!stop) System.out.println("Yes");
		//System.out.println(Arrays.toString(he));
		br.close();
	}

}


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

#include<iostream>

using namespace std;
int main()
{
  int n;
  cin>>n;
  vector<int> all;
  for(int i = 1; i<n;i++)
  {
    if( (all.at(i)-all.at(i-1)) >1)
    {
      cout<<"No"<<endl;
      return 0;
    }
    else if((all.at(i)-all.at(i-1)) ==1)
    {
      all.at(i)--;
    }
    else
    {
      continue;
    }
  }
  cout<<"Yes"<<endl;
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> all;
      |   ^~~~~~
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 | 
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> all;
      |          ^~~
a.cc:11:10: error: 'all' was not declared in this scope; did you mean 'atoll'?
   11 |     if( (all.at(i)-all.at(i-1)) >1)
      |          ^~~
      |          atoll
Language: C++

#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>
 
using namespace std;
 
// conversion
//------------------------------------------
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T> inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
 
// math
//-------------------------------------------
template <class T> inline T sqr(T x) { return x * x; }
 
// typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
// container util
//------------------------------------------
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i, c)                                                             \
  for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())
 
// repetition
//------------------------------------------
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
 
// constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
 
// clear memory
#define CLR(a) memset((a), 0, sizeof(a))
 
// debug
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x)                                                               \
  cerr << #x << " = " << (x) << " (L" << __LINE__ << ")"                       \
       << " " << __FILE__ << endl;
 
const string YES = "Yes";
const string NO = "No";
 
void solve(long long n, std::vector<long long> h) {
  vector<long long> H;
  H.PB(h[0]);
  for(int i=1; i< n; i++){
    if(h[i-1]!=h[i])H.PB(h[i]);
  }
  long long N = H.size();
  if(N==1){
    cout<<"Yes"<<endl;
    return;
  }
  else if(N==2){
    if(H[0]-H[1]>1)cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
    return;
  }
  else{
    for(int i=1; i<N-1; i++){
 
      if(H[i-1]<=H[i] && H[i]<=H[i+1]){continue;}
      else{
        if(H[i-1]<=H[i]-1 && H[i]-1<=H[i+1]){
          H[i]--;
        }
        else{cout<<"No"<<endl; return;}
      }
    }
    
  }

Compiler output:
a.cc: In function 'void solve(long long int, std::vector<long long int>)':
a.cc:114:4: error: expected '}' at end of input
  114 |   }
      |    ^
a.cc:86:51: note: to match this '{'
   86 | void solve(long long n, std::vector<long long> h) {
      |                                                   ^
Language: C++

//   _/                _/                 _/_/_/   _/
//_/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
// _/     _/    _/   _/     _/    _/  _/_/_/     _/
//_/     _/    _/   _/     _/    _/  _/    _/   _/
// _/_/   _/_/       _/_/   _/_/      _/_/     _/
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const double pi=3.14159265358979323846;
const int inf=2e9;
const ll INF=9e18;
typedef pair<int,int> P;
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  int n,h[100005]={};
  cin >> n;
  for(int i=0; i<n; i++) {
    cin >> h[i];
  }
  for(int i=n-1; i>=1; i--) {
    if(a[i-1]>a[i]) {
      a[i-1]--;
    }
    if(a[i-1]>a[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
int h[maxn];
int main()
{
	ios::sync_with_stdio(false);
    cin.tie(0);
   	cout.tie(0);
    int n;
    cin>>n>>h[1];
    int low=h[1]-1;
    bool f=true;
    for(int i=2;i<=n;i++)
    {
        cin>>h[i];
        if(h[i]>low)
        {
            low=h[i]-1;
        }
        else if(h[i]==low)
        {
            low=h[i];
        }
        else
        {
            f=false;
        }

    }
    if(f)
        cout<<"Yes";
    else
        cout << "No";
	return 0;
}



Compiler output:
a.cc:3:7: error: 'maxn' was not declared in this scope
    3 | int h[maxn];
      |       ^~~~
a.cc: In function 'int main()':
a.cc:10:13: error: 'h' was not declared in this scope
   10 |     cin>>n>>h[1];
      |             ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;

//// C
int main(){
    int n; cin >> n;
    vector<int> v(n);
    rep(i,n) cin >> v[i];
    int pre = -999;
    rep(i,n){
        if(pre <= v[i]-1){
            pre = v[i]-1;
        }else if(pre <= v[i]){
            pre = v[i];
        } else{
            puts("No");
            retrun 0;
        }
    }
    puts("Yes");
    retrun 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: 'retrun' was not declared in this scope
   20 |             retrun 0;
      |             ^~~~~~
a.cc:24:5: error: 'retrun' was not declared in this scope
   24 |     retrun 0;
      |     ^~~~~~
Language: C++

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

if N == 1:
  print('YES')
  exit

H_rev = list(reversed(H))

ans = 'YES'
for i in range(N-1):
  if H_rev[i] < H_rev[i+1]:
    H_rev[i+1] -= 1

  if H_rev[i] < H_rev[i+1]:
    ans = 'NO'
    break

print(ans)

Compiler output:
a.cc:5:9: warning: multi-character character constant [-Wmultichar]
    5 |   print('YES')
      |         ^~~~~
a.cc:10:7: warning: multi-character character constant [-Wmultichar]
   10 | ans = 'YES'
      |       ^~~~~
a.cc:16:11: warning: multi-character character constant [-Wmultichar]
   16 |     ans = 'NO'
      |           ^~~~
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <numeric>
#include <complex>
#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> h(n);
    rep(i,n) cin >> h[n];

    for(int i = 0; i < n-1; ++i){
        if(h[i] - h[i+1] > 1){
            cout << "No" << endl;
            return 0;
        }
        else if(h[i] - h[i+1] == 1 && h[i+1] - h[i+2] == 1)){
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:60: error: expected primary-expression before ')' token
   34 |         else if(h[i] - h[i+1] == 1 && h[i+1] - h[i+2] == 1)){
      |                                                            ^
Language: C++

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

int main(){
  int N; 
  cin >> N;
  vector<longt> v(N);
  
  for(int i=0; i < N; i++){
    cin >> v.at(i);
  }
  
  for(int i=0; i<N-2;i++){
    if(v[i] < v[i+1] && v[i+1] == v[i+2] + 1){
      v[i+1] = v[i+1] - 1;
    }
  }
  string ans = "Yes";
  for(int i = 0; i < N-1; i++){
    if(v[i] > v[i+1]){
      ans = "No";
      break;
    }
  }
  
  cout << ans << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'longt' was not declared in this scope; did you mean 'long'?
    7 |   vector<longt> v(N);
      |          ^~~~~
      |          long
a.cc:7:15: error: template argument 1 is invalid
    7 |   vector<longt> v(N);
      |               ^
a.cc:7:15: error: template argument 2 is invalid
a.cc:10:14: error: request for member 'at' in 'v', which is of non-class type 'int'
   10 |     cin >> v.at(i);
      |              ^~
a.cc:14:9: error: invalid types 'int[int]' for array subscript
   14 |     if(v[i] < v[i+1] && v[i+1] == v[i+2] + 1){
      |         ^
a.cc:14:16: error: invalid types 'int[int]' for array subscript
   14 |     if(v[i] < v[i+1] && v[i+1] == v[i+2] + 1){
      |                ^
a.cc:14:26: error: invalid types 'int[int]' for array subscript
   14 |     if(v[i] < v[i+1] && v[i+1] == v[i+2] + 1){
      |                          ^
a.cc:14:36: error: invalid types 'int[int]' for array subscript
   14 |     if(v[i] < v[i+1] && v[i+1] == v[i+2] + 1){
      |                                    ^
a.cc:15:8: error: invalid types 'int[int]' for array subscript
   15 |       v[i+1] = v[i+1] - 1;
      |        ^
a.cc:15:17: error: invalid types 'int[int]' for array subscript
   15 |       v[i+1] = v[i+1] - 1;
      |                 ^
a.cc:20:9: error: invalid types 'int[int]' for array subscript
   20 |     if(v[i] > v[i+1]){
      |         ^
a.cc:20:16: error: invalid types 'int[int]' for array subscript
   20 |     if(v[i] > v[i+1]){
      |                ^
Language: C++

//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <bits/stdc++.h>
#include<queue>
#include <numeric>
#include<stdio.h>
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define int long long

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define fore(i,a) for(auto &i:a)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
 

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

LL lcm(LL a, LL b){
    LL g = gcd(a,b);
    return a/g *b;
}

int main(){
    int N;
    cin >> N;
    int A[1000000];
    REP(i,N) cin >> A[i];
    bool exist=true;
    for(int i=0;i<N-1;++i){
        if(A[i]>A[i+1]){
            if(A[i]+1==A[i+1]){
                A[i]+=1;
            }
    }
    }
    for(int i=0;i<N-1;++i){
        if(A[i]>A[i+1]){
            exist=false;
            break;
        }
    }
    if(exist) cout << "Yes";
    else cout << "No";
        }

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

//左から右に単調非減少
//h[i=2~n]は増え続ける
//(h[i] - max_h) > 0
//(h[i] - max_h) == -1 h[i]++
//(h[i] - max_h) > -1 false 


int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n;
    cin>>n;
    vector<ll> h(n+2,0);
    max_h = -1;
    h[n+1] = INF;
    bool flag = true;
    for(int i = 1; i <= n; i++){
        if((h[i] - max_h) == -1) h[i]++;
        else if((h[i] - max_h) > -1) flag = false; break;
        max_h = max(max_h,h[i]);
    }

    if( flag ) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'max_h' was not declared in this scope
   18 |     max_h = -1;
      |     ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  cin >> N;
  vector<int> vec(N);
  
  for(int i = 0; i<N; i++){
    cin >> vec.at(i);
  }
  
  int now = vec[0];
  bool bonus = true;
  bool ans = true;
  
  for(int i = 1; i < N; i++){
    if(now <= vec[i]){
      now = vec[i];
      continue;
    } 
    if(now == vec[i] +1){
      if(bonus){
        bonus = false;
        continue;
      }else{
        ans = false;
        break;
      }
    }
    if(now > vec[i] + 1){
      ans = false;
      break;
    }
  }

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

/**
 * Mob Pro
 * 20200120
 **/
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
    int n; cin >> n;
    vector<int> h(n);
    for(int i=0; i<n; i++) cin >> h[i];
        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:13:15: error: 'i' was not declared in this scope
   13 |         if (h[i] > h[i+1]) {
      |               ^
a.cc:16:15: error: 'i' was not declared in this scope
   16 |         if (h[i] > h[i+1]) {
      |               ^
a.cc: At global scope:
a.cc:21:7: error: 'cout' does not name a type
   21 |       cout << "Yes" << endl;
      |       ^~~~
a.cc:22:7: error: expected unqualified-id before 'return'
   22 |       return 0;
      |       ^~~~~~
a.cc:23:2: error: expected declaration before '}' token
   23 |  }
      |  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  bool ans=true;
  cin>>n;
  vector<int> vec(n);
  for(int i=0; i<n; i++){
    cin>>vec(i);
  }
  vec.at(0)=vec.at(0)-1;
  for(int i=1; i<n; i++){
    if(vec.at(i)-vec.at(i-1)>0){
      vec.at(i)=vec.at(i)-1;
    }
    if(vec.at(i)-vec.at(i-1)<0){
      ans=false;
      break;
    }
  }
  string str="Yes";
  if(ans){
    cout<<str;
  }
  else{
    str="No";
    cout<<str;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: no match for call to '(std::vector<int>) (int&)'
   10 |     cin>>vec(i);
      |          ~~~^~~
Language: C++

#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include <map>
#include <cmath>
#include <string>
using namespace std;
 
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REP(i,a,b)for(int i=(int)(a);(i)<(int)(b);i++)
typedef long long ll;
 
using namespace std;
 
int main() {
    int n;
    cin >> n;
    vector<ll> stairs(n);
 
    rep(i, n) {
        cin >> stairs.at(i);
    }
 
    ll lower_flg = 0;
    rep(i, n - 1) {
        if (stairs.at(i) - stairs.at(i+1) >= 2)
        {
            /* code */
            lower_flg = 2;
            break;
        }
        
        if (stairs.at(i) > stairs.at(i+1))
        {
            stairs.at(i) -= 1;
            lower_flg++;
            if (stairs.at(i) > stairs.at(i+1))
            { 
                lower_flg++;
            }
        }
    }
    string ans = (lower_flg <= 1) ? "Yes" : "No";
    cout << ans << en

Compiler output:
a.cc: In function 'int main()':
a.cc:44:20: error: 'en' was not declared in this scope; did you mean 'n'?
   44 |     cout << ans << en
      |                    ^~
      |                    n
a.cc:44:22: error: expected '}' at end of input
   44 |     cout << ans << en
      |                      ^
a.cc:15:12: note: to match this '{'
   15 | int main() {
      |            ^
Language: C++

#pragma gcc optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V)) //小さい方からソート
#define REV(V) reverse(ALL(V)) //リバース
#define RSORT(V) REV(SORT(V)) //大きい方からソート
#define NPN(V) next_permutation(ALL(V)) //順列
#define pb(n) push_back(n)
#define endl '\n'
#define Endl '\n'
#define DUMP(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define RAPID cin.tie(0);ios::sync_with_stdio(false)
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c 
#define VIN(V) for(int i = 0; i < (V).size(); i++) {cin >> (V).at(i);}
#define OUT(n) cout << n << endl
#define VOUT(V) for(int i = 0; i < (V).size(); i++) {cout << (V).at(i) << endl;}

// 型マクロ定義
#define int long long
#define P pair<ll,ll>
#define Vi vector<ll>
#define Vd vector<double>
#define Vs vector<string>
#define Vc vector<char>
#define M map<ll,ll>
#define S set<ll>
#define PQ priority_queue<ll>
#define PQG priority_queue<ll,V,greater<ll>
//

const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int gcd(int a,int b){return b?gcd(b,a%b):a;} //最小公倍数

// デフォルト変数定義
int n,m,a,b,c,x,y,z;
double d,e,f;
string s,t;
bool flg = true;
//

signed main() {
  RAPID;
  IN(n);
  Vi h(n);
  VIN(h)
  REP(i,(n-1)){
    if(i[i+1] - i[i] > 1){
      flg=false;
      break;
    }
  }
  Yes(flg);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:9: error: invalid types 'long long int[long long int]' for array subscript
   61 |     if(i[i+1] - i[i] > 1){
      |         ^
a.cc:61:18: error: invalid types 'long long int[long long int]' for array subscript
   61 |     if(i[i+1] - i[i] > 1){
      |                  ^
Language: C++

#pragma gcc optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V)) //小さい方からソート
#define REV(V) reverse(ALL(V)) //リバース
#define RSORT(V) REV(SORT(V)) //大きい方からソート
#define NPN(V) next_permutation(ALL(V)) //順列
#define pb(n) push_back(n)
#define endl '\n'
#define Endl '\n'
#define DUMP(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define RAPID cin.tie(0);ios::sync_with_stdio(false)
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c 
#define VIN(V) for(int i = 0; i < (V).size(); i++) {cin >> (V).at(i);}
#define OUT(n) cout << n << endl
#define VOUT(V) for(int i = 0; i < (V).size(); i++) {cout << (V).at(i) << endl;}

// 型マクロ定義
#define int long long
#define P pair<ll,ll>
#define Vi vector<ll>
#define Vd vector<double>
#define Vs vector<string>
#define Vc vector<char>
#define M map<ll,ll>
#define S set<ll>
#define PQ priority_queue<ll>
#define PQG priority_queue<ll,V,greater<ll>
//

const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int gcd(int a,int b){return b?gcd(b,a%b):a;} //最小公倍数

// デフォルト変数定義
int n,m,a,b,c,x,y,z;
double d,e,f;
string s,t;
bool flg = true;
//

signed main() {
  RAPID;
  IN(n);
  Vi h(n);
  VIN(h)
  REP(i,n-1){
    if(i[i+1] - i[i] > 1){
      flg=false;
      break;
    }
  }
  Yes(flg);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:9: error: invalid types 'long long int[long long int]' for array subscript
   61 |     if(i[i+1] - i[i] > 1){
      |         ^
a.cc:61:18: error: invalid types 'long long int[long long int]' for array subscript
   61 |     if(i[i+1] - i[i] > 1){
      |                  ^
Language: C

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

int main(){
  int n;
  int *h;
  int i;
  
  scanf("%d",&n);
  h=(int*)malloc(sizeof(int)*n);
  for(i=0;i<n;i++){
    scanf("%d",&h[i]);
  }
  
  if(n==1){
    printf("Yes");
    return;
  }
  
  for(i=0;i<n;i++){
    if((h[i]-h[i+1])==1){
      count++;
    } else if((h[i]-h[i+1])>=2 || count>=2){
      printf("No");
      return;
    } else if((h[i]-h[i+1])<0){
      count=0;
    }
  }
  printf("Yes");
  free(h);
}


Compiler output:
main.c: In function 'main':
main.c:17:5: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   17 |     return;
      |     ^~~~~~
main.c:4:5: note: declared here
    4 | int main(){
      |     ^~~~
main.c:22:7: error: 'count' undeclared (first use in this function)
   22 |       count++;
      |       ^~~~~
main.c:22:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:25:7: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   25 |       return;
      |       ^~~~~~
main.c:4:5: note: declared here
    4 | int main(){
      |     ^~~~
Language: C++

#include <vector>
#include <math.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <iomanip>
#include <deque>
#include <map>

typedef long long ll;
#define rep(i, a, n) for(int i = a; i<n; i++)
#define ALL(a) begin(a), end(a)
#define mii map<int, int>
#define msi map<string, int>
#define vi vector<int>
#define vl vector<ll>
#define MOD 1000000007
#define INF 1e9
#define showVector(v) rep(i,0,v.size()){p(v[i]);p(" ")} pl("")
#define p(s) std::cout << s ;
#define pl(s)  std::cout << s << endl;
using namespace std;

// 素数判定 O(√n)
bool is_prime(int n){
    for(int i = 2; i * i <= n; i++){
        if(n % i == 0) return false;
    }
    return true;
}

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

}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main() {
    ll N, H;
    cin >> N;
    vl a(N);
    rep(i, 0, N) {
        cin >> a[i];
    }

    rep(i, 1, N) {
        if (a[i-1] > a[i]) {
            cout << "No" << endl;
            return 0;
        } else {
            if (a[i] != a[i-1]) {
            --a[i];
        }
    }
    cout << "Yes" << endl;
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define INF 1e10
#define MOD 1e9+7
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using Graph = vector<vector<int>>;
signed main(){
  int a;
    vector<int> b(a);
  rep(i,a)
    cin>>b[i];
  int c=0;
  rep(i,a){
  if(c<a[i])
    c=a[i];
    if(c-a[i]>=2){
      cout<<"NO";
      return 0;
      }
  }
  cout<<"YES";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: invalid types 'long long int[long long int]' for array subscript
   23 |   if(c<a[i])
      |         ^
a.cc:24:8: error: invalid types 'long long int[long long int]' for array subscript
   24 |     c=a[i];
      |        ^
a.cc:25:11: error: invalid types 'long long int[long long int]' for array subscript
   25 |     if(c-a[i]>=2){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define INF 1e10
#define MOD 1e9+7
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using Graph = vector<vector<int>>;
signed main(){
  int a：
    vector<int> b(a);
  rep(i,a)
    cin>>b[i];
  int c=0;
  rep(i,a){
  if(c<a[i])
    c=a[i];
    if(c-a[i]>=2){
      cout<<"NO";
      return 0;
      }
  }
  cout<<"YES";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: expected initializer before 'vector'
   18 |     vector<int> b(a);
      |     ^~~~~~
a.cc:19:9: error: 'a' was not declared in this scope
   19 |   rep(i,a)
      |         ^
a.cc:4:32: note: in definition of macro 'rep'
    4 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                ^
a.cc:20:10: error: 'b' was not declared in this scope
   20 |     cin>>b[i];
      |          ^
a.cc:22:9: error: 'a' was not declared in this scope
   22 |   rep(i,a){
      |         ^
a.cc:4:32: note: in definition of macro 'rep'
    4 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                ^
Language: C++

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

int main(){
  int N;
  bool ans = true;
  cin >> N;
  int H[N];
  for (int x : H) cin >> X;
  for (int i = 0; i < (N - 1); i++){
    if (abs(H[i] - H[i + 1]) > 1) ans = false;
  }
  cout << (ans ? "Yes" : "No")
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: 'X' was not declared in this scope
    9 |   for (int x : H) cin >> X;
      |                          ^
a.cc:13:31: error: expected ';' before '}' token
   13 |   cout << (ans ? "Yes" : "No")
      |                               ^
      |                               ;
   14 | }
      | ~
Language: C++

/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(LL &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const LL &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("# ");printf(__VA_ARGS__);puts("");}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
int H[SIZE];
int main(){
    int N;
    R(N);
    FOR(i,1,N){
        R(H[i]);
    }
    for(i=N-1;i>-;i--){
        if(H[i]>H[i+1])H[i]--;
    }
    FOR(i,2,N){
        if(H[i]<H[i-1]){
            W("No");
            return 0;
        }
    }
    W("Yes");
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:78:9: error: 'i' was not declared in this scope
   78 |     for(i=N-1;i>-;i--){
      |         ^
a.cc:78:18: error: expected primary-expression before ';' token
   78 |     for(i=N-1;i>-;i--){
      |                  ^
Language: C++

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



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

    int a[n+5];

    rep(i,n){
        cin >> a[i];

        if(i==0) continue;

        if(a[i]+1<a[i-1]){
            cout << "No"<< endl;
            return 0;
        }

        }
        
    }


    cout << "Yes" << endl;

    return 0;
}

Compiler output:
a.cc:30:5: error: 'cout' does not name a type
   30 |     cout << "Yes" << endl;
      |     ^~~~
a.cc:32:5: error: expected unqualified-id before 'return'
   32 |     return 0;
      |     ^~~~~~
a.cc:33:1: error: expected declaration before '}' token
   33 | }
      | ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define int ll
#define double long double
#define nn '\n'
#define YES cout<<"YES"<<'\n'
#define NO cout<<"NO"<<'\n'
#define Yes cout<<"Yes"<<'\n'
#define No cout<<"No"<<'\n'
#define yes cout<<"yes"<<'\n'
#define no cout<<"no"<<'\n'
void YN(bool flg){cout<<(flg?"YES":"NO")<<'\n';}
void Yn(bool flg){cout<<(flg?"Yes":"No")<<'\n';}
void yn(bool flg){cout<<(flg?"yes":"no")<<'\n';}
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define out(n) cout << n << '\n';
typedef vector<int> VI;
typedef vector<VI> VVI;
const int MOD = 1000000007;
const long long INF = 10e10;
const double PI = acos(-1.0);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
int POW(int a, int n) { int r = 1; while (n > 0) { if (n & 1)r *= a; a *= a; n /= 2; }return r; }
int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*素因数分解*/map< int, int >prime_factor(int n){map< int, int > ret;for(int i = 2; i * i <= n; i++) {while(n % i == 0) {ret[i]++;n /= i;}}if(n != 1) ret[n] = 1;return ret;}
/*約数列挙*/vector<int> divisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}
//----------------ライブラリとか----------------

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(15);

    int n; cin >> n;
    VI h(n); REP(i,n) cin >> h[i];
    int now = h[n-1];
    for(int i=n-2; i>=0; i--){
        if(now>=h[i])continue;
        else if(now<h[i]-1){No; return 0}
        else h[i]--;
    }
    Yes;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:41: error: expected ';' before '}' token
   53 |         else if(now<h[i]-1){No; return 0}
      |                                         ^
      |                                         ;