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

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

int main() {
    int i, j;
    int n;
    int long h[100000] = {0};
    int max = 0;

    scanf("%d", &n);
    for(i = 0; i < n; i++){
       scanf("%d", &h[i]);
    }
    for(i = 0; i < n - 1; i++){
        for(j = i+1; j < n; j++){
            if(h[i] > h[j]){
                h[i]--;
                break;
            }
        }
    }
    max = h[0];
    for(i = 0; i < n; i++{
        if(max > h[i]){
            printf("No\n");
            return 0;
        }
        if(max < h[i]) max = h[i];
    }
    printf("Yes\n");

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:25:26: error: expected ')' before '{' token
   25 |     for(i = 0; i < n; i++{
      |        ~                 ^
      |                          )
main.c:35:1: error: expected expression before '}' token
   35 | }
      | ^
Language: C++

#include<stdio.h>
#include <algorithm>
using namespace std;
using ll = long long int;
int main()
{
	// freopen("in","r",stdin);
	int t=1;
	while(t--){
		int n;
		scanf("%d",&n);
		ll s[n];
		for (int i = 0; i < n; ++i)
		{
			scanf("%lld",s+i);
		}
		ll mtn = min(0,s[0]-1);
		bool done[n] = {0};
		bool ok = true;
		for (int i = 1; i < n; ++i){
			if(s[i]==mtn) continue;
			else if(s[i]>mtn){
				mtn = s[i]-1;
			}
			else{
				printf("NO\n");
				ok = false;
				break;
			}
		}
		if(ok)
			printf("Yes\n");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:29: error: no matching function for call to 'min(int, ll)'
   17 |                 ll mtn = min(0,s[0]-1);
      |                          ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:17:29: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   17 |                 ll mtn = min(0,s[0]-1);
      |                          ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:17:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   17 |                 ll mtn = min(0,s[0]-1);
      |                          ~~~^~~~~~~~~~
Language: C++

#include (bits/stdc++.h)
using namespace std;

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

Compiler output:
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include (bits/stdc++.h)
      |          ^
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>> n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include (bits/stdc++.h)
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> mao(n);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #include (bits/stdc++.h)
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> mao(n);
      |          ^~~
a.cc:9:11: error: 'mao' was not declared in this scope
    9 |     cin>> mao.at(i);
      |           ^~~
a.cc:14:11: error: 'mao' was not declared in this scope
   14 |       if (mao.at(i)-1 > mao.at(j)) {
      |           ^~~
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout<< "Yes" <<endl;
      |     ^~~~
a.cc:23:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:20: error: 'endl' was not declared in this scope
   23 |     cout<< "Yes" <<endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #include (bits/stdc++.h)
a.cc:25:5: error: 'cout' was not declared in this scope
   25 |     cout<< "No" <<endl;
      |     ^~~~
a.cc:25:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:19: error: 'endl' was not declared in this scope
   25 |     cout<< "No" <<endl;
      |                   ^~~~
a.cc:25:19: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include<stdio.h>
#include <algorithm>
using namespace std;
int main()
{
	// freopen("in","r",stdin);
	int t=1;
	while(t--){
		int n;
		scanf("%d",&n);
		ll s[n];
		for (int i = 0; i < n; ++i)
		{
			scanf("%lld",s+i);
		}
		ll mtn = min(0,s[0]-1);
		bool done[n] = {0};
		bool ok = true;
		for (int i = 1; i < n; ++i){
			if(s[i]==mtn) continue;
			else if(s[i]>mtn){
				mtn = s[i]-1;
			}
			else{
				printf("NO\n");
				ok = false;
				break;
			}
		}
		if(ok)
			printf("Yes\n");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'll' was not declared in this scope
   11 |                 ll s[n];
      |                 ^~
a.cc:14:38: error: 's' was not declared in this scope
   14 |                         scanf("%lld",s+i);
      |                                      ^
a.cc:16:19: error: expected ';' before 'mtn'
   16 |                 ll mtn = min(0,s[0]-1);
      |                   ^~~~
      |                   ;
a.cc:20:28: error: 's' was not declared in this scope
   20 |                         if(s[i]==mtn) continue;
      |                            ^
a.cc:20:34: error: 'mtn' was not declared in this scope
   20 |                         if(s[i]==mtn) continue;
      |                                  ^~~
Language: C

#include <stdio.h>
int main(){
int a,i,b[],c=0;
scanf("%d",&a);
for(i=0;i<a;i++){
scanf("%d ",&b[i]);
}
for(i=0;i<a;i++){
if(b[i]<=b[i+1])c=1;
if(b[i]-1<=b[i+1]||b[i]-1>=b[i+1])c=1;
}
if(c==1)
printf("Yes");
else if
printf("No");
}

Compiler output:
main.c: In function 'main':
main.c:3:9: error: array size missing in 'b'
    3 | int a,i,b[],c=0;
      |         ^
main.c:15:1: error: expected '(' before 'printf'
   15 | printf("No");
      | ^~~~~~
      | (
Language: C++

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

int n, h[100000];

int main()
{
    scanf("%d", &n);
    n--;
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &h[i]);
    }
    for (int i = 0; i < n; i++)
    {
        // if (i > 0)
        // {
        //     if (h[i] >= h[i - 1])
        //     {
        //     }
        //     else
        //     {
        //         printf("No");
        //         return 0;
        //     }
        // }

        if (i < n - 1)
        {
            if (h[i + 1] >= h[i] ||() h[i + 1] >= h[i] - 1&&h[i] - 1 >= h[i - 1])
            {
            }
            else
            {
                printf("No");
                return 0;
            }
        }
    }
    printf("Yes");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:37: error: expected primary-expression before ')' token
   30 |             if (h[i + 1] >= h[i] ||() h[i + 1] >= h[i] - 1&&h[i] - 1 >= h[i - 1])
      |                                     ^
a.cc:30:38: error: expected ')' before 'h'
   30 |             if (h[i + 1] >= h[i] ||() h[i + 1] >= h[i] - 1&&h[i] - 1 >= h[i - 1])
      |                ~                     ^~
      |                                      )
Language: C++

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int main(){
    ll n,h,m=0;
    cin>>n>>hp;
    for(ll i=0;i<n;i++){
        cin>>h;
        if(h>m) m=h;
        else{
            if(m-h>1){
                cout<<"No"<<endl;
                break;
            }
        }
        if(i==n-1) cout<<"Yes"<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'hp' was not declared in this scope; did you mean 'h'?
   10 |     cin>>n>>hp;
      |             ^~
      |             h
Language: Java

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int[] h = new int[a];
		for(int i = 0; i < a; i++){
			h[i] = sc.nextInt();
		}
		boolean flg = true;
		for(int i = h.length-1; i >= 0; i--){
			for(int j = 0; j < i; j++){
				if(h[i]-h[j] >= 2){
					flg = false;
				}
			}
		}
		if(flg){
			System.out.println("Yes");
		}
		else{
			System.out.println("No");
		}
	}

}

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;
typedef long long ll;
const long long mod=1e9+7; //10^9+7

int main() {
    int n;
    ll h[200000];
    int sw[200000];

    cin >> n;
    for(int i=0; i<n; i++){
        cin >> h[i];
        sw[i] = 0;
    }
    if(n==1){
        cout << "Yes" << endl;
        return 0;
    }
    int flg = 0;
    for(int i=0; i<n-1; i++){
        if(h[i]>h[i+1]+1){
            flg = 1;
        } else if(h[i]==h[i+1]+1){
            h[i]--;
            sw[i] = 1;
            for(int j=i; j>0;j--){
                if( h[j-1] > h[j]+1 ){
                    flg = 1;
                    break;
                }else if(h[j-1]==h[j]+1){
                    if(sw[j-1]==1){
                        flg = 1;
                        break;
                    }else{
                        h[j-1]--;
                        sw[j-1] = 1;
                    }
                }else if((h[j-1]<=h[j]){
                    break;
                }
            }
        }
        if(flg == 1) break;
    }

    if(flg == 1) cout << "No" << endl;
    else cout << "Yes" << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:40: error: expected ')' before '{' token
   40 |                 }else if((h[j-1]<=h[j]){
      |                         ~              ^
      |                                        )
a.cc:43:13: error: expected primary-expression before '}' token
   43 |             }
      |             ^
Language: C++

include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  int h[n],d[n];
  for(int i=0;i<n;i++){
    cin >> h[i];
  }
  for(int i=1;i<n;i++){
    d[i]=h[i]-h[i-1];
  }
  d[0]=1;
  for(int i=1;i<n;i++){
    cerr << i;
    if(d[i]>=0);
    else if(d[i]==-1){
      if(d[i-1]>0);
      else goto no;
    }
    else goto no;
  }
  cout << "Yes" << endl;
  return 0;
  
no:
  cout << "No" << endl;
  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> n;
      |   ^~~
a.cc:15:5: error: 'cerr' was not declared in this scope
   15 |     cerr << i;
      |     ^~~~
a.cc:23:3: error: 'cout' was not declared in this scope
   23 |   cout << "Yes" << endl;
      |   ^~~~
a.cc:23:20: error: 'endl' was not declared in this scope
   23 |   cout << "Yes" << endl;
      |                    ^~~~
Language: C++

#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
//inline int in() { int x; scanf("%d",&x); return x;}
inline ll in() { ll x; cin >> x; return x; }
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
const int MX = 200005;

// maxとmaxより後ろにあるminが2離れたらNo
int main() {
  int n = in();
  vector<ll> h; rep(i,n) h.pb(in());
  max = 0;
  rep(i,n) {
    if (h[i]>max)
      max = h[i];
    else if (h[i] <= max - 2) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:9: error: overloaded function with no contextual type information
   63 |   max = 0;
      |         ^
a.cc:65:13: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} and '<unresolved overloaded function type>' to binary 'operator>'
   65 |     if (h[i]>max)
a.cc:66:16: error: overloaded function with no contextual type information
   66 |       max = h[i];
      |                ^
a.cc:67:26: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   67 |     else if (h[i] <= max - 2) {
      |                      ~~~~^~~
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
	    int buildcnt = sc.nextInt();
//      List<Integer> numlist = new ArrayList<Integer>();
//      while(sc.hasnext()){
  //      numlist.add(sc.nextInt());
    //  }
      
      boolean reach =false;
      String answer = "YES";
      int now = sc.nextInt();
      while(sc.hasnext()){
       int next = sc.nextInt();
       //今-次が2以上ならNG
       if(now - next >= 2){
         answer="NO";
         break;
       }else if(now - next == 1){
        
         if(reach == true){
          answer ="NO";
           break;
         }else{
           reach=true;
           now = next;
         }
       }else{
        now = next;
        reach=false;
       }
      }
        // 出力 
		System.out.println(answer);
	}
}

Compiler output:
Main.java:14: error: cannot find symbol
      while(sc.hasnext()){
              ^
  symbol:   method hasnext()
  location: variable sc of type Scanner
1 error
Language: C++

#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define inf 1e+9
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }

int main (){
	cin.tie(0);
   	ios::sync_with_stdio(false);

    ll n,k,ans=0;
	string s;
	cin >> n;
	ll a[n];
	rep(i,n){
		cin >> a[i];
	}

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

	// rep(i,n-1){
	// 	if(a[i]-a[i+1]>=2){
	// 		cout << "No" << endl;
	// 		return 0;
	// 	}
	// 	else if(a[i]>a[i+1]){
	// 		a[i]--;
	// 		ans++;
	// 	}
	// }

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

	cout << "Yes" << endl;


	// if(ans<=1){
	// 	cout << "Yes" << endl;
	// }
	//

Compiler output:
a.cc: In function 'int main()':
a.cc:78:31: error: expected '}' at end of input
   78 |         cout << "Yes" << endl;
      |                               ^
a.cc:38:12: note: to match this '{'
   38 | int main (){
      |            ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>

using namespace std;

int main(void) {
	int N;
	int count = 0;
	cin >> N;
	vector<int>H(N);
	vector<int>I(N);
	for (int i = 0; i < N; i++) {
		cin >> H[i];
	}
	I = H;
	sort(I.begin(), I.end());
	if (N == 1) {
		cout << "Yes";
	}
	else {
		for (int i = 0; i < N - 1; i++) {
			if (H[i] > H[i + 1]) {
				H[i] = H[i] - 1;
			}
		}
		
	}
	if (H == I) {
		cout << "Yes";
	}
  　else {
		cout << "No";
	}
	
	return 0;
}

Compiler output:
a.cc:33:3: error: extended character 　 is not valid in an identifier
   33 |   　else {
      |   ^
a.cc: In function 'int main()':
a.cc:33:3: error: '\U00003000else' was not declared in this scope
   33 |   　else {
      |   ^~~~~~
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
	    int buildcnt = sc.nextInt();
//      List<Integer> numlist = new ArrayList<Integer>();
//      while(sc.hasnext()){
  //      numlist.add(sc.nextInt());
    //  }
      
      boolean reach =false;
      String answer = "YES";
      int now = sc.nextInt();
      while(sc.hasnext()){
       int next = sc.nextInt();
       //今-次が2以上ならNG
       if(now - next >= 2){
         answer="NO";
         break;
       }else if(now - next == 1){
        
         if(reach == true){
          answer ="NO";
           break;
         }else{
           reach=true;
           now = next;
         }
       }else{
        now = next;
        reach=false;
       }
      

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

Compiler output:
Main.java:39: error: reached end of file while parsing
}
 ^
1 error
Language: C++

#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define inf 1e+9
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }

int main (){
	cin.tie(0);
   	ios::sync_with_stdio(false);

    ll n,k,ans=0;
	string s;
	cin >> n;
	ll a[n];
	rep(i,n){
		cin >> a[i];
	}

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

	// rep(i,n-1){
	// 	if(a[i]-a[i+1]>=2){
	// 		cout << "No" << endl;
	// 		return 0;
	// 	}
	// 	else if(a[i]>a[i+1]){
	// 		a[i]--;
	// 		ans++;
	// 	}
	// }

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

	cout << "Yes" << endl;


	// if(ans<=1){
	// 	cout << "Yes" << endl;
	// }
	// else{
	// 	cout << "No" << endl;
	// }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:34: error: expected ';' before '{' token
   55 |                 else(a[i-1]>a[i]){
      |                                  ^
      |                                  ;
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
	    int buildcnt = sc.nextInt();
//      List<Integer> numlist = new ArrayList<Integer>();
//      while(sc.hasnext()){
  //      numlist.add(sc.nextInt());
    //  }
      
      boolean reach =false;
      String answer = 'YES';
      int now = sc.nextInt();
      while(sc.hasnext()){
       int next = sc.nextInt();
       //今-次が2以上ならNG
       if(now - next >= 2){
         answer='NO';
         break;
       }else if(now - next == 1){
        
         if(reach == true){
          answer ='NO';
           break;
         }else{
           reach=true;
           now = next;
         }
       }else{
        now = next;
        reach=false;
       }
      

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

Compiler output:
Main.java:12: error: unclosed character literal
      String answer = 'YES';
                      ^
Main.java:12: error: unclosed character literal
      String answer = 'YES';
                          ^
Main.java:12: error: not a statement
      String answer = 'YES';
                        ^
Main.java:18: error: unclosed character literal
         answer='NO';
                ^
Main.java:18: error: unclosed character literal
         answer='NO';
                   ^
Main.java:18: error: not a statement
         answer='NO';
                  ^
Main.java:23: error: unclosed character literal
          answer ='NO';
                  ^
Main.java:23: error: unclosed character literal
          answer ='NO';
                     ^
Main.java:23: error: not a statement
          answer ='NO';
                    ^
Main.java:39: error: reached end of file while parsing
}
 ^
10 errors
Language: Java

mport java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String line1 = scanner.nextLine();
        int count = Integer.parseInt(line1);

        if (count == 1) {
            System.out.println("Yes");
        }

        String line2 = scanner.nextLine();
        String[] token = line2.split(" ");
        int[] height = new int[count];
        for (int i=0; i<count; i++) {
            height[i] = Integer.parseInt(token[i]);
        }

        try {
            int[] newHeight = new int[count];
            for (int i = count - 1; i > 0; i--) {
                if (i == count - 1) {
                    newHeight[i] = height[i];
                }
                int diff = height[i - 1] - newHeight[i];
                if (diff > 1) {
                    throw new RuntimeException();
                } else if (diff == 1) {
                    newHeight[i - 1] = height[i - 1] - 1;
                } else {
                    newHeight[i - 1] = height[i - 1];
                }
            }
            System.out.println("Yes");
        } catch (RuntimeException e) {
            System.out.println("No");
        }
    }

}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	int arr[n];
	for(int i=0;i<n;i++)
	{
		cin>>arr[i];

	}
	if(n==1)
		{cout<<"Yes"<<endl;
			return 0;}
	for(int i=n-1;i>=1;;i--)
	{
		if(arr[i]<arr[i-1])
		{
			arr[i-1]--;
			if(arr[i]==arr[i-1])
				continue;
			else
			{
				cout<<"No"<<endl;
				return 0;
			}
		}
	}
	cout<<"Yes"<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:28: error: expected primary-expression before ';' token
   15 |         for(int i=n-1;i>=1;;i--)
      |                            ^
a.cc:15:28: error: expected ')' before ';' token
   15 |         for(int i=n-1;i>=1;;i--)
      |            ~               ^
      |                            )
a.cc:15:29: error: 'i' was not declared in this scope
   15 |         for(int i=n-1;i>=1;;i--)
      |                             ^
Language: C++

// -_-
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define fi first
#define se second
#define rz resize
#define fori(i, a, b) for(int i = a; i <= b; i++)
#define ford(i, a, b) for(int i = a; i >= b; i--)
#define mod 1000000007
#define  sort1(v) sort(v.begin(), v.end()) 
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair <int, int>> vpi;

 
signed main() 
{

	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int n;
	cin >> n;
	int h[n+1];
	h[0] = -1;
	fori(i, 1, n) cin >> h[i];
	fori(i, 1, n-1)
	{
		if(h[i] > h[i+1] || i == 1)
			h[i]--;
			if(h[i] > h[i+1] || (h[i-1] > h[i]))
			{
				cout << "No";
				return 0;
			}
			
	}
	fori
	cout << "Yes";

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:9: error: 'fori' was not declared in this scope
   45 |         fori
      |         ^~~~
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];
}
int adm=1;
bool f=true; 
for(int i=0;i<N-1;i++){
 if(H[i]<=H[i+1]){ adm=H[i+1]-H[i]; }
 else if(H[i]==H[i+1]+1){ if(adm>=1){adm=0;}else{f=false;break;} };
 else{f=false;break;}
}
if(f){ cout << "Yes"; }else{ cout << "No"; }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:2: error: 'else' without a previous 'if'
   15 |  else{f=false;break;}
      |  ^~~~
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
	    int buildcnt = sc.nextInt();
//      List<Integer> numlist = new ArrayList<Integer>();
//      while(sc.hasnext()){
  //      numlist.add(sc.nextInt());
    //  }
      
      boolean reach =false;
      String answer = 'YES';
      int now = sc.nextInt();
      while(sc.hasnext()){
       int next = sc.nextInt();
       //今-次が2以上ならNG
       if(now - next >= 2){
         answer='NO';
         break;
       }else if(now - next == 1){
        
         if(reach == true){
          answer ='NO';
           break;
         }else{
           reach=true;
           
        now = next;
       }else{
        now = next;
        reach=false;
       }
      

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

Compiler output:
Main.java:12: error: unclosed character literal
      String answer = 'YES';
                      ^
Main.java:12: error: unclosed character literal
      String answer = 'YES';
                          ^
Main.java:12: error: not a statement
      String answer = 'YES';
                        ^
Main.java:18: error: unclosed character literal
         answer='NO';
                ^
Main.java:18: error: unclosed character literal
         answer='NO';
                   ^
Main.java:18: error: not a statement
         answer='NO';
                  ^
Main.java:23: error: unclosed character literal
          answer ='NO';
                  ^
Main.java:23: error: unclosed character literal
          answer ='NO';
                     ^
Main.java:23: error: not a statement
          answer ='NO';
                    ^
Main.java:29: error: 'else' without 'if'
       }else{
        ^
Main.java:39: error: reached end of file while parsing
}
 ^
11 errors
Language: C++

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

int main() {
  int n;
  cin >> n;
  if(n == 1) {
    cout << "Yes" << endl;
  }
  else{
    vector<long> h(n);
    vector<long> hh(n-1);
    for(int i=0;i<n;i++){
      cin >> h.at(i);
    }
    for(int i=0;i<n-1;i++){
      hh.at(i) = h.at(i+1) - h.at(i);
    }
    sort(hh.begin(),hh.end());
    int ans = 0;
    for(int i= 0;i<n-1;i++){
      if(hh.at(i) <0){
        ans++;
      }
    }
    if(ans > 1){
      cout << "No" << endl;
    }
    else if(hh.at(0) < -1){
      cout << "No" << endl;
    }
    else {
      cout << "Yes" << endl;
    }
    
       
  return 0;
}


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

#include <iostream>
#include <stdio.h>
#include <cmath>
#include <algorithm> // sort
#include <map>       // pair
#include <vector>
using namespace std;

#define REP(a,b) for(int i =(a);i < (b);i++)
#define FOR(n) for(int i = 0; i<(n); i++)
#define COUT(c)  cout<<(c)<<endl


const int INF = 100100100;
const int MOD = (int)1e9 +7;
const double EPS = 1e-9; 

typedef long long int ll;

//char in[120];
//ex. pair
//pair<pair<string,int>,int> p[110];

int main(){
    ll n;cin>>n;
    ll pref=0,now=0;
    cin >> pref;
    pref = pref - 1;
    if(n==1){
        cout<< "Yes" << endl;
        return 0;
    }
    FOR(n-1){
        cin >> now;
        //cout << pref << " " <<now << endl;
        if(pref + 2 >= now){
            cout << "No" << endl;
            return 0;
        }else if( )

        if(pref > now){
            pref = now - 1;
        }else{
            pref = now;
        }
    }
    cout << "Yes" <<endl;
    return 0;    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:19: error: expected primary-expression before ')' token
   39 |         }else if( )
      |                   ^
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class C {

	public int low(int num) {
		return num--;
	}

	public static boolean isSort(ArrayList<Integer> list){
		for(int i=0;i<list.size()-1;i++) {
			if(list.get(i) >= list.get(i+1)) {
				return false;
			}
		}
		return true;
	}

	public static ArrayList<Integer> Sort(ArrayList<Integer> list){
		for(int i=0;i<list.size();i++) {
			list.set(i,list.get(i)-1);
			if(isSort(list)) {
				return list;
			}
			list.set(i,list.get(i)+1);
		}
		return new ArrayList<>();
	}

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<>();
		int N = sc.nextInt();
		for(int i=0;i<N;i++) {
			list.add(sc.nextInt());
		}
		if(Sort(list).isEmpty()) {
			System.out.println("No");
		}else {
			System.out.println("Yes");
		}


		sc.close();
	}

}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
 int n;
 cin >> n;
 string s;
 s = "Yes";
vector<int> vec(n);
for(int i=0;i < n;i++){
 cin >> vec(i);
}
for(int i =0;i < n;i++){
 if(vec.at(i)-vec.at(i+1) >=2){
    s = "No";
}
}
cout << s << endl;
}

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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll ;
int main () {
  
  ll N ;
  cin >> N ;
  ll a[N] ;
  for(int i =0 ; i < N ;i++)
    cin >> a[i] ;
  
  ll tot =0 ;
  for(int i = N - 2; i >=0 ;i--){
    if(a[i] - a[i + 1] == 1) {
      a[i] = a[i + 1] ;
      continue ;
    }
    if(a[i] - a[i + 1] >= 2) {
     flag = false ;
    }
  }
  if(tot == 1) cout<<"Yes\n" ;
  else cout<<"No\n" ;
  
  return 0 ;
}

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

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
using ll=long long;
static const ll mod = 1e9 + 7;
static  ll INF = 1e9;
using namespace std;

signed main(){
	ll n;
	cin>>n;
	vector<ll>h(n);
	ll maxv=0;
	rep(i,n)cin>>h[i];
	rep(i,n-1){
		maxv=max(maxv,h[i];)
		if(maxv-h[i]>1){
			cout<<"No"<<endl;
			return 0;
		}
			
	}
	cout<<"Yes"<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:35: error: expected ')' before ';' token
   32 |                 maxv=max(maxv,h[i];)
      |                         ~         ^
      |                                   )
a.cc:32:36: error: expected primary-expression before ')' token
   32 |                 maxv=max(maxv,h[i];)
      |                                    ^
Language: C++

# include <iostream>
# include <vector>
# include <math.h>
typedef long long ll;
using namespace std;

ll rem(ll num, ll a) {
    while (num >= a) {
        num -= a;
    }
    return num;
}

bool maxima(int index, int n, vector<int> &v) {
    int a = INT_MIN;
    int b = INT_MAX;
    if (index-1 > 0) {
        a = v[index-1];
    }
    if (index+1 < n) {
        b = v[index+1];
    }
    if (a<v[index] && v[index] > b) {
        return true;
    }
    return false;
}

int main() {
    int a;
    scanf("%d", &a);
    vector<int> v(a);
    for (int i=0; i<a; i++) {
        scanf("%d", &v[i]);
    }
    for (int i=0; i<a; i++) {
        if (maxima(i, a, v))
            v[i]--;
    }

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

Compiler output:
a.cc: In function 'bool maxima(int, int, std::vector<int>&)':
a.cc:15:13: error: 'INT_MIN' was not declared in this scope
   15 |     int a = INT_MIN;
      |             ^~~~~~~
a.cc:4:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | # include <math.h>
  +++ |+#include <climits>
    4 | typedef long long ll;
a.cc:16:13: error: 'INT_MAX' was not declared in this scope
   16 |     int b = INT_MAX;
      |             ^~~~~~~
a.cc:16:13: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

# include <iostream>
# include <vector>
typedef long long ll;
using namespace std;

ll rem(ll num, ll a) {
    while (num >= a) {
        num -= a;
    }
    return num;
}

bool maxima(int index, int n, vector<int> &v) {
    int a = INT_MIN;
    int b = INT_MAX;
    if (index-1 > 0) {
        a = v[index-1];
    }
    if (index+1 < n) {
        b = v[index+1];
    }
    if (a<v[index] && v[index] > b) {
        return true;
    }
    return false;
}

int main() {
    int a;
    scanf("%d", &a);
    vector<int> v(a);
    for (int i=0; i<a; i++) {
        scanf("%d", &v[i]);
    }
    for (int i=0; i<a; i++) {
        if (maxima(i, a, v))
            v[i]--;
    }

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

Compiler output:
a.cc: In function 'bool maxima(int, int, std::vector<int>&)':
a.cc:14:13: error: 'INT_MIN' was not declared in this scope
   14 |     int a = INT_MIN;
      |             ^~~~~~~
a.cc:3:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | # include <vector>
  +++ |+#include <climits>
    3 | typedef long long ll;
a.cc:15:13: error: 'INT_MAX' was not declared in this scope
   15 |     int b = INT_MAX;
      |             ^~~~~~~
a.cc:15:13: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll ;
int main () {
  
  ll N ;
  cin >> N ;
  ll a[N] ;
  for(int i =0 ; i < N ;i++)
    cin >> a[i] ;
  
  bool flag = true
  for(int i = N - 2; i >=0 ;i--){
    
    if(a[i] - a[i + 1] >=2 ) {
    flag = false ;break ;
    }
  }
  if(flag) cout<<"Yes\n" ;
  else cout<<"No\n" ;
  
  return 0 ;
}

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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

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


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

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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define vi vector<ll>
#define sll(x) scanf("%lld",&x)
#define prll(x) printf("%lld ",x)
#define pri(x) printf("%d ",x)
#define si(x) scanf("%d",&x)
#define el printf("\n")
#define pb push_back
#define f first
#define s second
#define arrondi(a) (long long)floor(a+0.5);
#define NIL -1
ll N=500005;
ll MAX=9223372036854775807;
ll MOD=1000000007;
long double PI =4*atan(1);

int main()
{
	IOS;
    cout.precision(30);
    int n; cin >> n; vector<ll> A(n,0);
    for (int i=0;i<n;i++)
    {
        cin >> A[i];
    }
    A[0]--;
    for (int i=1;i<n-1;i++)
    {
        if (A[i]>A[i+1])
        {
            A[i]--;
        }
    }
    bool res=true;
    for (int i=0;i<n-1;i++)
    {
        if (A[i]>A[i+1])
            res=false;
    }
    if (!res) cout << "No\n"; else cout << "Yes\n";
    return 0;
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | a#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'a' does not name a type
    1 | a#include <bits/stdc++.h>
      | ^
a.cc:20:19: error: 'atan' was not declared in this scope
   20 | long double PI =4*atan(1);
      |                   ^~~~
a.cc: In function 'int main()':
a.cc:4:13: error: 'ios' has not been declared
    4 | #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |             ^~~
a.cc:24:9: note: in expansion of macro 'IOS'
   24 |         IOS;
      |         ^~~
a.cc:4:38: error: 'cin' was not declared in this scope
    4 | #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                      ^~~
a.cc:24:9: note: in expansion of macro 'IOS'
   24 |         IOS;
      |         ^~~
a.cc:4:50: error: 'cout' was not declared in this scope
    4 | #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                                  ^~~~
a.cc:24:9: note: in expansion of macro 'IOS'
   24 |         IOS;
      |         ^~~
a.cc:26:22: error: 'vector' was not declared in this scope
   26 |     int n; cin >> n; vector<ll> A(n,0);
      |                      ^~~~~~
a.cc:5:12: error: expected primary-expression before 'long'
    5 | #define ll long long
      |            ^~~~
a.cc:26:29: note: in expansion of macro 'll'
   26 |     int n; cin >> n; vector<ll> A(n,0);
      |                             ^~
a.cc:29:16: error: 'A' was not declared in this scope
   29 |         cin >> A[i];
      |                ^
a.cc:31:5: error: 'A' was not declared in this scope
   31 |     A[0]--;
      |     ^
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<long int> h(n);
  for(int i = 0; i < n; i++) cin >> h[i];

  vector<long int> v(n);
  for(int i = 0; i < n; i++) v[i] = h[i];

  sort(v.begin(), v.end());
  // for(int i = 0; i < n; i++) cout << v[i] << " ";

  for(int i = 0; i < n; i++) {
    if(abs(h[i] - v[i]) > 1) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |   sort(v.begin(), v.end());
      |   ^~~~
      |   short
Language: C++

#include "SaveFuncs.cpp"

#include <iostream>
#include <array>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <iomanip>	//cout << fixed << setprecision(桁数);
#include <stdexcept>

using namespace std;
using ll = long long;

#define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; i++)
#define rep1(i, n) for(int i=1, i##_len=(n); i<i##_len; i++)
#define rrep(i, n) for(int i=(n)-1; i >= 0; i--)
#define rrep1(i, n) for(int i=(n); i > 0; i--)
#define all(x) (x).begin(), (x).end()
#define pair(a, b) make_pair(a, b);
//#define int long long
constexpr int INF = 2000000100;
constexpr int DIV = 1000000007;	// 10e9+7
template<class T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> T divUp(T a, T b) { if (a % b == 0) { return a / b; } return a / b + 1; }
string strMulti(string t, int n) { string out = ""; for (int i = 0; i < n; i++) { out += t; } return out; }

/*****/

int Main()
{
	int N;
	cin >> N;
	vector<int> H(N);
	rep(i, N)	cin >> H.at(i);

	bool isYes = true;

	for (int i = N - 2; i > 0; i--)
	{
		if (H.at(i) - H.at(i + 1) == 1)
		{
			H.at(i)--;
		}
		else if (H.at(i) - H.at(i + 1) > 1)
		{
			isYes = false;
			break;
		}
	}

	cout << (isYes ? "Yes" : "No") << endl;

	return 0;
}

/*****/

int main()
{
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);

	Main();

	return 0;
}


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

int main(void)
{
    std::cin.tie(0);
    std::ios_base::sync_with_stdio(false);
    //ここから本体
    int n = 0;
    cin >> n;
    vector<int> vec(n);
    REP(i, n)
    cin >> vec[i];

    int max = 0;
    bool isOk = true;
    for (int i = 0; i < n; i++)
    {
        if (max < vec[i])
        {
            max = vec[i];
        }
        if (max - 1 > vec[i])
        {
            isOk = false;
            break;
        }
    }
    if (isOk)
    {
        cout << "Yes";
    }
    else
    {
        cout << "No";
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:10: error: 'cin' is not a member of 'std'
    3 |     std::cin.tie(0);
      |          ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main(void)
a.cc:4:10: error: 'std::ios_base' has not been declared
    4 |     std::ios_base::sync_with_stdio(false);
      |          ^~~~~~~~
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin >> n;
      |     ^~~
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<int> vec(n);
      |     ^~~~~~
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> vec(n);
      |            ^~~
a.cc:9:9: error: 'i' was not declared in this scope
    9 |     REP(i, n)
      |         ^
a.cc:9:5: error: 'REP' was not declared in this scope
    9 |     REP(i, n)
      |     ^~~
a.cc:16:19: error: 'vec' was not declared in this scope
   16 |         if (max < vec[i])
      |                   ^~~
a.cc:20:23: error: 'vec' was not declared in this scope
   20 |         if (max - 1 > vec[i])
      |                       ^~~
a.cc:28:9: error: 'cout' was not declared in this scope
   28 |         cout << "Yes";
      |         ^~~~
a.cc:32:9: error: 'cout' was not declared in this scope
   32 |         cout << "No";
      |         ^~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> h(N);
  string r = "Yes";
  
  for (int i = 0; i < N; i++)
    cin >> h.at(i);
  
  for (int i = 0; i < N - 1; i++) {
    
    if (h.at(i) > h.at(i+1))
      r = "No"
      break;
  }  
  cout << r << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: expected ';' before 'break'
   16 |       r = "No"
      |               ^
      |               ;
   17 |       break;
      |       ~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
	int n;
	cin >> n;
	
	std::vector<int> h(n);
	for (int i = 0; i < n; ++i) {
		cin >> h.at(i);
	}
	
	int highest = 0;
	bool flag = true;
	
	for (int i = 0; i < n; ++i) {
		if (h.at(i) < highest - 1) {
			flag = false;
		}
		highest = max(highest, h.at(i));
	}
	
	if (flag) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
	
	return 0;
}#include <bits/stdc++.h>

using namespace std;

int main(){
	int n;
	cin >> n;
	
	std::vector<int> h(n);
	for (int i = 0; i < n; ++i) {
		cin >> h.at(i);
	}
	
	int highest = 0;
	bool flag = true;
	
	for (int i = 0; i < n; ++i) {
		if (h.at(i) < highest - 1) {
			flag = false;
		}
		highest = max(highest, h.at(i));
	}
	
	if (flag) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
	
	return 0;
}

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

#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
 
using namespace std;
 
 
int main()
{	int n = 0;
 	int sum = 0;
 	cin>>n;
    vector<int> v;
 for(int i = 0;i<n;i++){
  int a = 0;
   cin>>a;
   v.push_back(a);
 }
    
int gensyou = 0;
 for(int i = n-1;i>0;i--){
if(v[i]>=v[i -1]){

}else if(v[i]>=v[i - 1] - 1 ){
 v[i - 1] =v[i - 1] -1;  
     
 }else{
 cout<<"No"
     return 0;
 }
 }
 cout<<"Yes";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:12: error: expected ';' before 'return'
   28 |  cout<<"No"
      |            ^
      |            ;
   29 |      return 0;
      |      ~~~~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n;cin>>n;
  int a[n];
  for(int i = 0; n > i; i++)cin>>a[i];
  int mx = 0;
  for(int i = 0; n > i; i++){
    if(mx > a[i]){
      cout << "No" << endl;
      return 0;
    }
    mx = max(mx,a[i]-1);
  }
  cout << "Yes" << endl;
    

Compiler output:
a.cc: In function 'int main()':
a.cc:15:25: error: expected '}' at end of input
   15 |   cout << "Yes" << endl;
      |                         ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^