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

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

#define REP(i, n) for (int i = 0; i < (n); ++i)

/***** MAIN *****/
signed main() {
  int n, ans=0;
  scanf("%d", &n);

  int boxes[n];
  REP(i,n) scanf("%d", &boxes[i]);
  if(n == 1) {
    cout << "Yes\n";
    return 0;
  }

  bool continueFlag = false;
  REPS(i,1,n) {
    int upDiff = boxes[i] - boxes[i-1];
    if(upDiff >= 1) {
      continueFlag = false;
    } else if(upDiff == 0) {
      // keep the status
    } else if(upDiff == -1) {
      if(continueFlag) {
        cout << "No\n";
        return 0;
      }
      continueFlag = true;
    } else {
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes";
  cout << "\n";
  return 0;
}
/***** MAIN *****/


Compiler output:
a.cc: In function 'int main()':
a.cc:19:8: error: 'i' was not declared in this scope
   19 |   REPS(i,1,n) {
      |        ^
a.cc:19:3: error: 'REPS' was not declared in this scope; did you mean 'REP'?
   19 |   REPS(i,1,n) {
      |   ^~~~
      |   REP
Language: C++

n = int(input())
a = list(map(int, input().split()))
i = 0
a.append(10000000);
while (i < n):
    if (a[i+1] <= a[i]):
        a[i] -= 1
    i += 1
j = 0
falsecount = 0
while (j < n-1):
    if (a[j] > a[j+1]):
        falsecount += 1
    j += 1
if (falsecount == 0):
    print('Yes')
else:
    print('No')

Compiler output:
a.cc:16:11: warning: multi-character character constant [-Wmultichar]
   16 |     print('Yes')
      |           ^~~~~
a.cc:18:11: warning: multi-character character constant [-Wmultichar]
   18 |     print('No')
      |           ^~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
a.cc:5:1: error: expected unqualified-id before 'while'
    5 | while (i < n):
      | ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
int q[100000000];
signed main(){
  int b=0,c=0,d=0,e,f,a;
  cin>>a;
  for(int i=0;i<a;i++) cin>>q[i];
  for(int i=a-1;i>0;i--){
    if(q[i]-c>=q[i-1]) c=0;
      else {
        if(q[i]-c>=q[i-1]-1) c=1;
        else{ 
          d=1;
          return 0;
        }
      }
    }
  }
if(d) cout<<"No";
else cout<<"Yes";
cout<<"\n";
}

Compiler output:
a.cc:20:1: error: expected unqualified-id before 'if'
   20 | if(d) cout<<"No";
      | ^~
a.cc:21:1: error: expected unqualified-id before 'else'
   21 | else cout<<"Yes";
      | ^~~~
a.cc:22:1: error: 'cout' does not name a type
   22 | cout<<"\n";
      | ^~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

#include <bits/stdc++.h>

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

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: 'tab' was not declared in this scope; did you mean 'tan'?
   12 |     maks=max(maks,tab[i]);
      |                   ^~~
      |                   tan
Language: C++

#include <iostream>
using namespace std;


int main() {
	int n;
  	cin>>n;
  	int h[n];
  	for(int i = 0; i < n; i++) cin>>h[i];
  	
  	for(int i = n -1 ; i >= 0; i--) {
     	if(h[i] < h[i-1]) {
         if(abs(h[i] - h[i-1]) > 1) {cout<<"No"<<"\n"; return 0;} 
         else max(h[i],h[i-1]) -= 1;
        }
    }
  cout<<"Yes"<<"\n";
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:32: error: assignment of read-only location 'std::max<int>(h[i], h[(i - 1)])'
   14 |          else max(h[i],h[i-1]) -= 1;
      |               ~~~~~~~~~~~~~~~~~^~~~
Language: C++

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

typedef long long ll;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 1e6 + 5;

int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);
  cout << fixed << setprecision(12);
  int n; cin>>n;
  vector<int> v(n);
  for (int i=0; i<n; i++) cin>>v[i];
  if (n==1) out("Yes");
  a[0] = max(1, a[0]-1);
  for (int i=1; i<n; i++) {
    if (a[i]<a[i-1]) out("No");
    a[i] = max(a[i-1],a[i]-1);
  }
  out("Yes");
  

  return 0;
}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: lvalue required as left operand of assignment
   11 |     if(a[i]-a[i-1]=-1)
      |        ~~~~^~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: lvalue required as left operand of assignment
   11 |     if(a[i]-a[i-1]=-1)
      |        ~~~~^~~~~~~
Language: C++


#include <iostream>
using namespace std;

int main()
{
  cin >> N;
  int H;
  cin >> H;
  int i = 1;
  for (; i < N; ++i)
  {
    int _H;
    cin >> _H;
    if (H < _H - 1)
      break;
  }
  cout << (N == i ? "Yes" : "No");
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'N' was not declared in this scope
    7 |   cin >> N;
      |          ^
Language: C++

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

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

	vector<int> h(n);

	int mxh = 0;
	string ans = "Yes";

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

		if(h[i]>mxh){
			mxh = h[i];
		}

		ifelse(h[i]<mxh-1){
			ans = "No";
		}
	}

	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'ifelse' was not declared in this scope; did you mean 'sigrelse'?
   19 |                 ifelse(h[i]<mxh-1){
      |                 ^~~~~~
      |                 sigrelse
Language: C++

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

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

	vector<int> h(n);

	int mxh = 0;
	string ans = "Yes";

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

		if(h[i]>mxh){
			mxh = h[i];
		}

		if else(h[i]<mxh-1){
			ans = "No";
		}
	}

	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: expected '(' before 'else'
   19 |                 if else(h[i]<mxh-1){
      |                    ^~~~
      |                    (
Language: Java

import java.util.Scanner;

public class Main

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

    int N = Integer.parseInt(sc.next());

    long[] H = new long[N];
    for (int i = 0; i < N; i++) {
      H[i] = Long.parseLong(sc.next());
    }

    boolean bool = true;
    int cnt = 0;
    for (int i = H.length-1; i > 0; i--) {
      if (H[i] + 1 == H[i-1]) {
        if (cnt == 0) {
          cnt++;
          H[i-1]--;
        }
        if (cnt > 1) {
          bool = false;
          break;
        }
        continue;
      }

      if (H[i] + 2 <= H[i-1]) {
        bool = false;
        break;
      }
    }

    System.out.println(bool ? "Yes" : "No");
  }
}

// 1 2 4 3 2
// 1 2 3 3 2
// 1 2 

Compiler output:
Main.java:3: error: '{' expected
public class Main
                 ^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
  public static void main(String[] args) {
                ^
  (use --enable-preview to enable unnamed classes)
Main.java:38: error: class, interface, enum, or record expected
}
^
3 errors
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll=long long;
using vec=vector<ll>;
using Graph = vector<vector<ll>>;
#define loop(i,n) for(ll i=0;i<n;i++)
#define Loop(i, m, n) for(ll i = m;i < n;i++)
#define pool(i,n) for(ll i=n-1;i>=0;i--)
#define Pool(i, m, n) for(ll i=n-1;i>=m;i--)
#define MAX 99999999999ll
#define MIN -99999999999ll
#define setbit bitset<8>
#define flagcount __builtin_popcount
#define flag(x) (1<<x)
#define flagadd(bit,x) bit|=flag(x)
#define flagpop(bit,x) bit&=~flag(x) 
#define flagon(bit,i) bit&flag(i)
#define flagoff(bit,i) !(bit & (1<<i))
#define all(v) v.begin(),v.end()
#define low2way(v,x) lower_bound(all(v),x)
#define high2way(v,x) upper_bound(all(v),x)
#define count2way(v,x) high2way(v,x)-low2way(v,x)
#define lower(v,x) low2way(v,x)-v.begin() //1番左が0、もし見つから無いならｎを出力
#define higher(v,x) high2way(v,x)-v.begin()-1 //1番左が0、もし見つからないならn-1を出力（注意）
#define putout(x) cout<<x<<endl
#define Gput(a,b) G[a].push_back(b)
int main() {
  ll n;
  cin>>n;
  vec a(n);
  bool z=true;
  ll count=0;
  loop(i,n-1){
    if(count>1){
      z=false;
      break;
    }
    if(s[i]>s[i+1]+1){
      z=false;
      break;
    }
    if(s[i]>s[i+1]){
      count++;
      continue;
    }
     if(s[i]>s[i+1]){
      count++;
      continue;
    }
    if(s[i]<s[i+1]&&count>0){
      count=0;
      continue;
    }
    
  }
 
 
 
 if(z)putout("Yes");
  else putout("No");
 
 
 
 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:8: error: 's' was not declared in this scope
   39 |     if(s[i]>s[i+1]+1){
      |        ^
a.cc:43:8: error: 's' was not declared in this scope
   43 |     if(s[i]>s[i+1]){
      |        ^
a.cc:47:9: error: 's' was not declared in this scope
   47 |      if(s[i]>s[i+1]){
      |         ^
a.cc:51:8: error: 's' was not declared in this scope
   51 |     if(s[i]<s[i+1]&&count>0){
      |        ^
Language: Java

import java.util.Scanner;
class Main{


	static char[][] map;
	static final int MOD = 1000000007;


	static long[][] c;
	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();
		}
		for(int i = n-1;i >= 1;i--){
			if(h[i-1] > h[i]){
				h[i-1]--;
				if(h[i-1] > h[i]){
					System.out.println("No");
					return;
				}
			}
		}
		System.out.println("Yes");





	}



	static int gcd(int a,int b){				//最大公約数を返す
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	}
	static long gcd(long a,long b){
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	}



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




}



class Pair implements Comparable{
	int from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return   end- otherpair.end;
	}


import java.util.Scanner;
class Main{


	static char[][] map;
	static final int MOD = 1000000007;


	static long[][] c;
	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();
		}
		for(int i = n-1;i >= 1;i--){
			if(h[i-1] > h[i]){
				h[i-1]--;
				if(h[i-1] > h[i]){
					System.out.println("No");
					return;
				}
			}
		}
		System.out.println("Yes");





	}



	static int gcd(int a,int b){				//最大公約数を返す
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	}
	static long gcd(long a,long b){
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	}



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




}



class Pair implements Comparable{
	int from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return   end- otherpair.end;
	}








}










}






Compiler output:
Main.java:77: error: illegal start of type
import java.util.Scanner;
^
Main.java:77: error: <identifier> expected
import java.util.Scanner;
                        ^
2 errors
Language: C

#include<stdio.h>

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

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll inf = 100100100100100;
const ll mod = 1000000007;
int main(){
int n;
cin>>n;
vector<int>a(n);
for(int i=0;i<n;i++)cin>>a.at(i);
  bool check=true;
  int cnt=0;
  bool ok=true;
for(int i=0;i<n-1;i++){
  　
    if((!ok&&a[i]>a[i+1])||a.at(i)-a.at(i+1)>1)check=false;
    else if(a[i]>=a[i+1])ok=false;
    else if(a[i]<a[i+1])ok=true;
  
}
if(check)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}





Compiler output:
a.cc:15:3: error: extended character 　 is not valid in an identifier
   15 |   　
      |   ^
a.cc: In function 'int main()':
a.cc:15:3: error: '\U00003000' was not declared in this scope
   15 |   　
      |   ^~
a.cc:17:5: error: 'else' without a previous 'if'
   17 |     else if(a[i]>=a[i+1])ok=false;
      |     ^~~~
Language: C++

int N;			// マスの個数(1≦N≦10^5)
int h[MAX_N];	// マスの高さ(1≦h[i]≦10^5)

int main () {

	int ans = 1;

	// 整数の数の読込み
	scanf("%d", &N);

	// 
	scanf("%d", &h[0]); h[0]--;
	for(int i = 1; i < N; i++) {
		scanf("%d", &h[i]);
		if(h[i-1] > h[i]) h[i-1]--;
	}

	for(int i = 1; i < N; i++) {
		if(h[i-1] > h[i]) ans = 0;
	}
	if(ans == 1) printf("Yes\n");
	else printf("No\n");

	return 0;
}


Compiler output:
a.cc:2:7: error: 'MAX_N' was not declared in this scope
    2 | int h[MAX_N];   // マスの高さ(1≦h[i]≦10^5)
      |       ^~~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf' was not declared in this scope
    9 |         scanf("%d", &N);
      |         ^~~~~
a.cc:12:22: error: 'h' was not declared in this scope
   12 |         scanf("%d", &h[0]); h[0]--;
      |                      ^
a.cc:21:22: error: 'printf' was not declared in this scope
   21 |         if(ans == 1) printf("Yes\n");
      |                      ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int N;                  // マスの個数(1≦N≦10^5)
a.cc:22:14: error: 'printf' was not declared in this scope
   22 |         else printf("No\n");
      |              ^~~~~~
a.cc:22:14: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include <cstdio>

#define MAX_N 100001

/* -----------------------------------------------------------------------------
	大域データ
----------------------------------------------------------------------------- */
int N;			// マスの個数(1≦N≦10^5)
int h[MAX_N];	// マスの高さ

int main () {

	int ans = 1;

	// 整数の数の読込み
	scanf("%d", &N);

	// 
	scanf("%d", h);
	for(int i = 1; i < N; i++) {
		scanf("%d", h + i);
		if(h[i-1] > h[i]) h[i-1]--;
	}

	for(int i = 1; i < N; i++) {
		if(h[i-1] > h[i]) ans = 0;
	}
	if(ans == 1) printf("YES\n");
	else (ans == 1) printf("NO\n");

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:24: error: expected ';' before 'printf'
   29 |         else (ans == 1) printf("NO\n");
      |                        ^~~~~~~
      |                        ;
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n, a[100000];
  cin >> n;
  for(int i=0; i<n; i++){
    cin >> a[i];
  }
  bool flag = true;
  for(int i+0; i<n-1; i++){
    if(a[i] - a[i+1] > 1){
      flag = false;
      break;
    }
  }
  cout << (flag?"Yes":"No") << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: expected ';' before '+' token
   10 |   for(int i+0; i<n-1; i++){
      |            ^
      |            ;
a.cc:10:21: error: expected ')' before ';' token
   10 |   for(int i+0; i<n-1; i++){
      |      ~              ^
      |                     )
a.cc:10:23: error: 'i' was not declared in this scope
   10 |   for(int i+0; i<n-1; i++){
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 9999999999999999;
using ll = long long;
int main(){
  int N;
  cin>>N;
  int a[N];
  for(int i = 0;i<N;i++){
    cin>>a[i];
  }
  bool t = 0;
  for(int i = N-1;i>=0:i--){
    if(a[i]<a[i-1]){
      if(a[i] == (a[i-1]-1)){
        a[i-1] = a[i-1]-1;
      }
      else{
        t = 1;
        break;
      }
    }
  }
  if(t == 0){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
  return 0;
}
        

Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   14 |   for(int i = N-1;i>=0:i--){
      |                   ^
a.cc:14:23: error: expected ';' before ':' token
   14 |   for(int i = N-1;i>=0:i--){
      |                       ^
      |                       ;
a.cc:25:3: error: expected primary-expression before 'if'
   25 |   if(t == 0){
      |   ^~
a.cc:24:4: error: expected ';' before 'if'
   24 |   }
      |    ^
      |    ;
   25 |   if(t == 0){
      |   ~~
a.cc:25:3: error: expected primary-expression before 'if'
   25 |   if(t == 0){
      |   ^~
a.cc:24:4: error: expected ')' before 'if'
   24 |   }
      |    ^
      |    )
   25 |   if(t == 0){
      |   ~~
a.cc:14:6: note: to match this '('
   14 |   for(int i = N-1;i>=0:i--){
      |      ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector> //動的配列
#include <string>
#include <list> //双方向リスト
#include <map> //連想配列
#include <set> //集合
#include <stack>
#include <queue>
#include <deque>
#include <cmath>
#include <bitset>
#include <numeric>
#include <tuple>




typedef long long ll;


using namespace std;

typedef pair<int, int> P;
#define FOR(i,a,b) for(int i=(int)(a) ; i < (int) (b) ; ++i )
#define rep(i,n) FOR(i,0,n)
#define sz(x) int(x.size())


template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

//小さい順から取り出すヒープ
//priority_queue<ll, vector<ll>, greater<ll> > pque1;




int main(){
    int n;
    cin>>n;
    vector<int> v;
    rep(i,n) {
        int a;
        cin>>a;
        v.push_back(a);
    }
    int pre=-21;
    for (int i=0;i<n;i++){
        if (pre<=a[i]-1) {
            a[i]--;
            pre=a[i];
        } else if (pre <=a[i]){
            pre=a[i];
        } else {
            cout<<"No"<<endl;
            return 0;
        }
    }
    
    cout<<"Yes"<<endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:56:18: error: 'a' was not declared in this scope
   56 |         if (pre<=a[i]-1) {
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    vector<long long int> v;
    for(int i = 0;i < n;i++)
    {
        int x;
        cin >> x;
        v.push_back(x);
    }
    bool flag = true;
    if(n == 2)
    {
        if((v.at(0) - v.at(1)) >= 2)
        {
            cout << "No";
            return 0;
        }
        else
        {
            cout << "Yes";
            return 0;
        }        
    }
    for(int i = 0;i + 2 < n;i++)
    {
        if((v.at(i) - v.at(i + 1) >= 2) || v.at(i) > v.at(i + 1) && v.at(i + 1) > v.at(i + 2))
        {
            flag = false;
            break;
        }
    }
    if((v.at[n - 2] - v.at[n - 1]) >= 2)
    {
        flag = false;
    }
    if(flag)
    {
        cout << "Yes";
    }
    else
    {
        cout << "No";
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:13: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   36 |     if((v.at[n - 2] - v.at[n - 1]) >= 2)
      |             ^
a.cc:36:27: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   36 |     if((v.at[n - 2] - v.at[n - 1]) >= 2)
      |                           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long int N; cin>>N;
    vector<long long int> H(N);
    for(long long int i=0;i<N;i++){
        cin>>H[i];
    }
    long long int M;
    for(int i=0;i<N;i++){
        M=max(a,H[i]);
        if(H[i]<M-1){
            cout<<"No";
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: 'a' was not declared in this scope
   11 |         M=max(a,H[i]);
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll= long long;
using vi= vector<int>;
using vvi= vector<vi>;
using vd= vector<double>;
using vc= vector<char>;
#define REP(i,x,n) for(int i=x; i<n; i++)
#define rep(i,n) REP(i,0,n)
#define all(x) x.begin(), x.end()


int main(){
  string ans="Yes";
  int n,i=0,high;
  cin >> n;
  vi h(n);
  rep(i,n)  cin >> h[i];

  rep(i,n-1){
    if(h[i]-1<=h[i+1]){
      continue;
      if(i && h[i-1]-1>h[i+1]){
        ans= "No"
      }
    }
    else{
      ans= "No";
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:18: error: expected ';' before '}' token
   24 |         ans= "No"
      |                  ^
      |                  ;
   25 |       }
      |       ~
Language: Java

import java.util.Scanner;

public class CBuildStairs {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int[] arr = new int[x];
		for(int i = 0; i<x;i++)arr[i]=sc.nextInt();
		boolean works = true;
		for(int i = 0;i<x;i++) {
			for(int j = i+1;j<x;j++) {
				if(arr[i]-1>arr[j]) {
					works = false;
					break;
				}
			}
		}
		System.out.println(works?"Yes":"No");

	}

}


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

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

int main(){
	int n;
	cin >> n;
	vector<int> h(n);
	rep(i,n) cin >> h[i];
	h[0]--;
	int flag=1
	rep(i,n-1){
		if(h[i] <h[i+1]) h[i+1]--;
		if(h[i] >h[i+1]) flag=0;
	}
	if(flag == 1) cout << 'Yes' << endl;
	else cout << 'No' << endl;
	return 0;
}



Compiler output:
a.cc:18:31: warning: multi-character character constant [-Wmultichar]
   18 |         if(flag == 1) cout << 'Yes' << endl;
      |                               ^~~~~
a.cc:19:22: warning: multi-character character constant [-Wmultichar]
   19 |         else cout << 'No' << endl;
      |                      ^~~~
a.cc: In function 'int main()':
a.cc:2:18: error: expected ',' or ';' before 'for'
    2 | #define rep(i,n) for(int i=0; i<n; i++)
      |                  ^~~
a.cc:14:9: note: in expansion of macro 'rep'
   14 |         rep(i,n-1){
      |         ^~~
a.cc:14:13: error: 'i' was not declared in this scope
   14 |         rep(i,n-1){
      |             ^
a.cc:2:31: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0; i<n; i++)
      |                               ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <queue>
#include <cmath>
#include <stack>
typedef long long ll;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mod 1000000007
const long long INF = 1LL<<60;


int main(){	
	int N;
	cin >> N;
	vector<int> H(N);
	for(int i = 0; i < N; i++){
		cin >> H[i];
	}
	bool can = false;
	for(int i = N-1; i <= 0; i--){
		if(H(N-1) >= H(i)){
			can = true;
		}else{
			H[i] -= 1;
		}
		for(int i = 0; i < N; i++){
			for(int j = 0; j < N; j++){
				if(H[i] <= H[j]){
					can = true;
			}
		}
	}
	if(can){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:21: error: no match for call to '(std::vector<int>) (int)'
   25 |                 if(H(N-1) >= H(i)){
      |                    ~^~~~~
a.cc:25:31: error: no match for call to '(std::vector<int>) (int&)'
   25 |                 if(H(N-1) >= H(i)){
      |                              ~^~~
a.cc:42:2: error: expected '}' at end of input
   42 | }
      |  ^
a.cc:16:11: note: to match this '{'
   16 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
 
using namespace std;
using S = set<long long>;
using D = deque<long long>;
using L = vector<long long>;
using M = map<int,long long>;
using A = vector<vector<long long>>;
using Q = priority_queue<long long>;
using U = unordered_map<int,long long>; //mapとの違いはkeyの順番を保持していない

#define sorted(vector) sort(vector.begin(),vector.end()) //O(nlongn)
#define vmin(vector) *min_element(vector.begin(),vector.end()) //O(N)
#define vmax(vector) *max_element(vector.begin(),vector.end()) //O(N)
#define vsum(vector) accumulate(vector.begin(),vector.end(),0) //O(N)
#define vcount(vector,a) count(vector.begin(), vector.end(),a) //O(N)
#define bisect_left(vector,a) (lower_bound(vector.begin(),vector.end(),a)-vector.begin())
#define bisect_right(vector,a) (upper_bound(vector.begin(),vector.end(),a)-vector.begin())
#define vfind(vector,a) find(vector.begin(), vector.end(), a) != vector.end() //遅いからあんまり使うな
//存在確認はmap!!!!!!!!!!!!!
//__gcd(a,b)はコンパイラがGCC時のみ

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    long long n,pre;
    cin>>n;
    L l(n,0);
    
    for(int i=n-1  ;i>-1  ;i--){
        cin>>l[i];
    }
    pre=l[0];
    for(int i=1  ;i<n  ;i++){
        if (l[i-1]<l[i]){
            l[i]-=1;
        }
        if (l[i-1]<l[i]){
            cout<<"No"<<endl;
            eixt(0);
        }
            
    }
    cout<<"Yes"<<endl;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:39:13: error: 'eixt' was not declared in this scope; did you mean 'exit'?
   39 |             eixt(0);
      |             ^~~~
      |             exit
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repl(i,n) for(int64_t i=0;i<(int64_t)(n);i++)
#define MAX_N 10000000
#define ll int64_t
#define all(v) (v).begin(),(v).end()
using namespace std;

int main() {
    //入力
    int n; cin>>n;
    vector<int> h(n);
    rep(i,n) cin>>h[i];
    int pre=-999;
    rep(i,n) {
        if(pre<=h[i]-1) {
            pre=h[i]-1;
        }
        else if(pre<=h[i]) {
            pre=a[i];
        }
        else{
            puts("No");
            return 0;
        }
    }
    puts("Yes");
    return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'a' was not declared in this scope
   20 |             pre=a[i];
      |                 ^
Language: Java

import java.util.Scanner;

public class C {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		final int N = scan.nextInt();
		long[] h = new long[N];
		for(int i = 0; i < N; i++) {
			h[i] = scan.nextLong();
		}
		scan.close();
		// 末尾から見ていく
		for(int i = N - 2; i >= 0; i--) {
			if(h[i] - h[i + 1] == 1) {
				h[i]--;
			}else if(h[i] - h[i + 1] <= 2 ) {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}

}


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

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		final int N = scan.nextInt();
		long[] h = new long[N];
		for(int i = 0; i < N; i++) {
			h[i] = scan.nextLong();
		}
		scan.close();
		// 末尾から見ていく
		for(int i = N - 2; i >= 0; i--) {
			if(h[i] - h[i + 1] == 1) {
				h[i]--;
			}else if(h[i] - h[i + 1] <= 2 ) {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}

}

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

#include<iostream>
#include<vector>
using namespace std;
 
int main()
{
  int n;
  std::cin>>n;
  vector<int> h;
  vector<int> c;
  int i,input;
  for(i=0;i<n;i++)
  {
    std::cin>>input;
    h.push_back(input);
  }
  for(i=0;i<n-1;i++)
  {
    if(h[i]>h[i+1])
    {
      if(h[i]-1<=h[i+1])
        c.pushback(1);
      else 
      {
        c.pushback(0);
        std::cout<<"No";
      }
    }
  }
  for(i=0;i<n-1;i++)
  {
    if(c[i]==1&&c[i+1]==1)
    {
      std::cout<<"No";
      return 0;
    }
  }
  std::cout<<"Yes";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:11: error: 'class std::vector<int>' has no member named 'pushback'; did you mean 'push_back'?
   22 |         c.pushback(1);
      |           ^~~~~~~~
      |           push_back
a.cc:25:11: error: 'class std::vector<int>' has no member named 'pushback'; did you mean 'push_back'?
   25 |         c.pushback(0);
      |           ^~~~~~~~
      |           push_back
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n;
  std::cin>>n;
  vector<int> h;
  int i,input;
  for(i=0;i<n;i++)
  {
    std::cin>>input;
    h.push_back(input);
  }
  for(i=0;i<n-1;i++)
  {
    if(h[i]>h[i+1]&&h[i]-1>h[i+1])
    {
      std::cout<<"No";
      return 0;
    }
  }
  std::cout<<"Yes";
  return 0;
}

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(in, out);
        out.close();
    }

    static class Task {

        void solve(InputReader in, PrintWriter out) {
            int N = in.nextInt();
            int[] H = in.nextIntArray(N);
            
            if (N < 2) {
                out.println("Yes");
            } else {
                for (int i = N - 1; i >= 1; --i) {
                    if (H[i] < H[i - 1] - 1) {
                        out.println("No");
                        return;
                    } else if (H[i] == H[i - 1] - 1) {
                        H[i - 1]--;
                    }
                }
                out.println("Yes");
            }
        }

    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] nextIntArray(int size) {
            int[] arr = new int[size];
            for (int i = 0; i < size; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        long[] nextLongArray(int size) {
            long[] arr = new long[size];
            for (int i = 0; i < size; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }
    }


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

#include"bits/stdc++.h"
#include"math.h"
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std; 
int main(){
int N;cin>>N;
vector<long long>H(N);
rep(i,n)cin >> H.at(i);
bool T=false;
for(int i=0;i<N-1;i++){
if(H.at(i)>=H.at(i+1)||H.at(i)>=H.at(i+1)-1){continue;}
else{T=true;break;}}
if(T){cout <<"No"<<endl;}
else{cout<<"Yes"<<endl;}}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'n' was not declared in this scope
    8 | rep(i,n)cin >> H.at(i);
      |       ^
a.cc:3:32: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                ^
Language: C++

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

int main() {
  int n; cin>>n;
  bool x=1;
  vector<int> a(n);
  rep(i,n) cin>>a[i];

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

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

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

int main(){
  int n;
  vector<int> h(n);
  
  for(int i=0;i<n;i++) cin >> h[i];
  int pre = -10;
  for(int i=0;i<n;i++){
    if(pre<h[i]){
      pre = h[i]-1;
    }else if(pre==h[i]){
      pre = h[i];
    }else{
      puts("No");
      return 0;
    }
    puts("Yes");
  }

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

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;


void ABC136C()
{
	int N;
	cin >> N;
	vector<int> H(N);
	for (auto& x : H)
		cin >> x;

	int h = H[N - 1];
	for (int i = N - 2; i > -1; --i)
	{
		if (H[i] > h)
		{
			--H[i];
			if (H[i] > h)
			{
				cout << "No" << endl;
				return;
			}
		}
		h = H[i];
	}
	cout << "Yes" << endl;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
#define Would
#define you
#define please
#define repr(i, n) for(int i=n-1; i>0; i--)

using namespace std;

void solve() {
	int n; cin >> n;
	vector<int> H(n);
	rep(i, n) scanf("%d", &H[i]);

	bool flag = true;
	repr(i, n) {
		if (H[i - 1] > H[i]) {
			H[i - 1]--;
			if (H[i - 1] > H[i]) {
				flag = false;
				break;
			}
		}
	}

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

}

int main(void) {
	solve();
	Would you please return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:12:13: error: 'i' was not declared in this scope
   12 |         rep(i, n) scanf("%d", &H[i]);
      |             ^
a.cc:12:9: error: 'rep' was not declared in this scope; did you mean 'repr'?
   12 |         rep(i, n) scanf("%d", &H[i]);
      |         ^~~
      |         repr
Language: Java

import java.util.*;

public class MyClass {
    public static void main(String args[]) {
    Scanner read = new Scanner(System.in);
    int n = read.nextInt();
    int d[] = new int[n];
    d[0] = read.nextInt()-1;
    boolean ban=true;
    for(int i=1; i<n; i++){
        d[i]=read.nextInt();
        if(d[i-1] > d[i]){
            ban=false;
            break;
        }
        if(d[i-1] < d[i])
            --d[i];
    }
    
        if(ban)
           System.out.println("Yes");
        else
           System.out.println("No");
    
    
    
   
    }
}

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

    using namespace std;
    int main(){

        int n,x,y,c=0,j;
        bool r=false;
        scanf("%d",&n);
        scanf("%d",&x);
        y=x;
        n--;
        j=n;
        while(n--){
            scanf("%d",&x);
            if(r)y--;
            if(x>=y)c++;
            else c=0;
            if(x==y)r=false;
            else r=true;
            y=x;

        }
        if(c==j||c==j-1)printf("Yes");
        else printf("No");
        return 0;
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'scanf' was not declared in this scope
    6 |         scanf("%d",&n);
      |         ^~~~~
a.cc:21:25: error: 'printf' was not declared in this scope
   21 |         if(c==j||c==j-1)printf("Yes");
      |                         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 |     using namespace std;
a.cc:22:14: error: 'printf' was not declared in this scope
   22 |         else printf("No");
      |              ^~~~~~
a.cc:22:14: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
int main(){
    int n, ans=0;  cin >> n;
    vector<int> v;
    rep(i, n){
      cin >> v[i];
    }
    int flg=0;
    rep(i, n){
      if(v[i]>v[i+1]+1){
        cout << No; break;
      }else if(v[i]>v[i+1] && flg==0){
        flg=1;
      }else if(v[i]>v[i+1] && flg==1){
        cout << No; break;
      }else if(v[i]<v[i+1]){
        flg=0;
      }
    }
    if(i==n) cout << Yes;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'No' was not declared in this scope
   16 |         cout << No; break;
      |                 ^~
a.cc:20:17: error: 'No' was not declared in this scope
   20 |         cout << No; break;
      |                 ^~
a.cc:25:8: error: 'i' was not declared in this scope
   25 |     if(i==n) cout << Yes;
      |        ^
a.cc:25:22: error: 'Yes' was not declared in this scope
   25 |     if(i==n) cout << Yes;
      |                      ^~~
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <set>
#include <map>

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define for_p(i, a, b) for(int i = a; i < b; i++)
#define for_m(i, a, b) for(int i = a - 1; i >= b; i--)

//a = s1.size();
//vector<string> s1;
//string s2 = accumulate( s1.begin(), s1.end(), string() );

using namespace std;

int main()
{
  int a = 0 , b = 0, c = 0, d = 0, e = 0, f = 0;
  int i = 0, j = 0;
  double d1 = 0, d2 = 0, d3 = 0, d4 = 0, d5 = 0, d6 = 0;
  int a1[256], a2[512], a3[1024];
  char s1[200000], s2[200000], s3[200000];
  
  cin >> a;
  
  for(i = 0; i < a; i++){
    cin >> a1[i];
  }
  
  if(a == 1){
    cout << "Yes" << endl;
  }else if(a == 2){
    if(a1[0] > a1[1]){
      a1[0]--;
    }
    if(a1[0] <= a1[1]){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }else{
    for(i = 0; i < a - 1; i++){
      if(a1[i] > a1[i + 1]){
        a1[i]--;
      }
    }
    for(i = 0; i < a; i++){
      if(a[i] < a[i]){
        c++;
      }
    }
    if(c == 0){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }
}

  


Compiler output:
a.cc: In function 'int main()':
a.cc:57:11: error: invalid types 'int[int]' for array subscript
   57 |       if(a[i] < a[i]){
      |           ^
a.cc:57:18: error: invalid types 'int[int]' for array subscript
   57 |       if(a[i] < a[i]){
      |                  ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <set>
#include <map>

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define for_p(i, a, b) for(int i = a; i < b; i++)
#define for_m(i, a, b) for(int i = a - 1; i >= b; i--)

//a = s1.size();
//vector<string> s1;
//string s2 = accumulate( s1.begin(), s1.end(), string() );

using namespace std;

int main()
{
  int a = 0 , b = 0, c = 0, d = 0, e = 0, f = 0;
  int i = 0, j = 0;
  double d1 = 0, d2 = 0, d3 = 0, d4 = 0, d5 = 0, d6 = 0;
  int a1[256], a2[512], a3[1024];
  char s1[200000], s2[200000], s3[200000];
  
  cin >> a;
  
  for(i = 0; i < a; i++){
    cin >> a1[i];
  }
  
  if(a == 1){
    cout << "Yes" << endl;
  }else if(a == 2){
    if(a1[0] > a1[1]){
      a1[0]--;
    }
    if(a1[0] <= a1[1]){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }else{
    for(i = 0; i < a - 1; i++){
      if(a1[i] > a1[i + 1]){
        a1[i]--;
      }
    }
    for(i = 0; i < a; i++){
      if(a[i] < a[i]){
        c++;
      }
    }
    if(c == 0){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }
}

  cout << a * a * a << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:57:11: error: invalid types 'int[int]' for array subscript
   57 |       if(a[i] < a[i]){
      |           ^
a.cc:57:18: error: invalid types 'int[int]' for array subscript
   57 |       if(a[i] < a[i]){
      |                  ^
a.cc: At global scope:
a.cc:69:3: error: 'cout' does not name a type
   69 |   cout << a * a * a << endl;
      |   ^~~~
a.cc:70:1: error: expected declaration before '}' token
   70 | }
      | ^
Language: C++

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#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>

using namespace std;

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define PB push_back
#define MP make_pair
#define ll long long

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();}

int main(){
    std::ios::sync_with_stdio(false);
    int n;
    cin >> n;
    ll h[n];
    bool ret = true;
    bool prev_dec = false;
    for(int i=0;i<n;++i)
    {
        cin >> h[i];
    }

    if(n == 1)
    {
        cout << "Yes" << endl;
        return;
    }
    
    for(int i=0;i<n-1;++i)
    {
        ll diff = h[i+1] - h[i];
        if (diff < -1)
        {
            ret = false;
            break;
        }

        if(prev_dec && diff < 0)
        {
            ret = false;
            break;
        }

        if(diff == -1)
        {
            prev_dec = true;
        }
        else
        {
            prev_dec = false;
        }
        
    }

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

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

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

int main() {
  int N,n,b;
  cin >> N;
  string s;
  s="Yes";

  vector<int> H(N);
  for(int i=0;i<N;i++){
    cin >> H.at(i);
  }
  int i=0;
  H.at(0)--;
  while(i<(N-1)){
    if(H.at(i+1)>H.at(i)){
      H.at(i+1)--;
      }else if(H.at(i+1)<H.at(i){
      s="No";
      break;
    }
    
    i++;
  }
  cout << s << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:33: error: expected ';' before '{' token
   19 |       }else if(H.at(i+1)<H.at(i){
      |                                 ^
      |                                 ;
a.cc:24:8: error: expected ')' before ';' token
   24 |     i++;
      |        ^
      |        )
a.cc:19:15: note: to match this '('
   19 |       }else if(H.at(i+1)<H.at(i){
      |               ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
    int n;
    cin >> n;
    
    vector<int> h;
    for(int i=0; i<n; i++){
        int c;
        cin >> c;
        h.push_back(c);
    }
    reverse(h.begin(), h.end());

    for (int i = 1; i < n; i++)
    {
        if(h.at(i-1) < h.at(i)-1){
            cout << "No" << endl;
            return 0;
        }
        else if (h.at(i - 1) + 1 == h.at(i))
        {
            h.at(i)--;
        }
        if(h.at(i) < 0){
            cout << "No" << endl;
            return 0;
        }
    }

    // for (int i = 0; i < n; i++)
    // {
    //     cout << h.at(i) << " : ";
    // }

    cout << "Yes" << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'reverse' was not declared in this scope
   16 |     reverse(h.begin(), h.end());
      |     ^~~~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
    int n;
    cin >> n;
    
    vector<int> h(n);
    for(int i=0; i<n; i++){
        cin >> h.at(i);
    }
    reverse(h.begin(), h.end());

    for (int i = 1; i < n; i++)
    {
        if(h.at(i-1) < h.at(i)-1){
            cout << "No" << endl;
            return 0;
        }
        else if (h.at(i - 1) + 1 == h.at(i))
        {
            h.at(i)--;
        }
        if(h.at(i) < 0){
            cout << "No" << endl;
            return 0;
        }
    }

    // for (int i = 0; i < n; i++)
    // {
    //     cout << h.at(i) << " : ";
    // }

    cout << "Yes" << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'reverse' was not declared in this scope
   14 |     reverse(h.begin(), h.end());
      |     ^~~~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
    int n;
    cin >> n;
    
    vector<int> h(n);
    for(int i=0; i<n; i++){
        cin >> h[i];
    }
    reverse(begin(h), end(h));
    for (int i = 1; i < n; i++)
    {
        if(h[i-1] < h[i]-1){
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'reverse' was not declared in this scope
   14 |     reverse(begin(h), end(h));
      |     ^~~~~~~
Language: C

include <stdio.h>

int main(void) {
	long int n,i,j;
	scanf("%ld",&n);
	long int h[n];
	for(i=0;i<n;i++){
		scanf("%ld",&h[i]);
	}
	for(i=0;i<n-1;i++){
		j=i+1;
		if(h[i]<h[j]){
			h[j]-=1;
		}
	}
	for(i=0;i<n-1;i++){
		j=i+1;
		if(h[i]>h[j]){
			printf("No");
			return 0;
		}
	}
	printf("Yes");
	// your code goes here
	return 0;
}


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