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

/*
    @uthor: Amit Kumar
    user --> CodeChef: dr_virus_ ; Codeforces,AtCoder,Hackerearth,Hakerrank: dr_virus;
*/
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
//#define ln mp::cpp_int;
#define ll    long long
#define ld    long double
#define ull   unsigned long long
#define endl "\n"
ll google_itr = 1;
#define google(x) cout<<"\Case #"<<x<<"\:"
#define pi 3.14159265358979323846264338327950L

const ll mod = 1e9+7;
const ll inf = 1e18;

ll popcount(ll num){
    num = num - ((num >> 1) & 0x55555555);
    num = (num & 0x33333333) + ((num >> 2) & 0x33333333);
    return ((num + (num >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
}


void virus(){
        ll num;
        cin>>num;
        vector<ll> arr(num);
        for(auto &i:arr) cin>>i;
        if(is_sorted(arr.begin(),arr.end())){
            cout<<"Yes";
            return;
        }
        for(auto i=0;i<n-1;i++){
            if(arr[i+1]>arr[i]){
                if(abs(arr[i+1]-arr[i])>1){
                    cout<<"No";
                    return;
                }
            }
        }
        cout<<"Yes";
}


int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
  /*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif*/

    ll t = 1;
    //cin>>t;
    while(t--){
           auto start = high_resolution_clock::now();
           virus();
           auto stop = high_resolution_clock::now();
           auto duration = duration_cast<seconds>(stop - start);
         //cout << "Time: "<<duration.count()<<endl;
        //your code goes here
    }
    return 0;
}

Compiler output:
a.cc: In function 'void virus()':
a.cc:39:24: error: 'n' was not declared in this scope
   39 |         for(auto i=0;i<n-1;i++){
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
#define VB vector<bool>
#define VP vector<pair<ll,ll>>
#define VVL vector<vector<ll>>
#define VVP vector<vector<pair<ll,ll>>>
#define PL pair<ll,ll>
#define ALL(v) (v).begin(), (v).end()

int main() {
    ll N;
    cin>>N;
    VL H(N);
    ll flg=1;
    ll ma=0;
    rep(i,0,N){
        cin>>H[i];
        ma=max(ma,H[i]);
        if(i!=0){
            ll d=H[i]-H[i-1];
            if(H[i]-ma<-1)flg*=0
            //if(d<-1)flg*=0;
            if(i==N-1&&d<-1)flg*=0;
        }
    }
    cout<<(flg ? "Yes":"No")<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:33: error: expected ';' before 'if'
   25 |             if(H[i]-ma<-1)flg*=0
      |                                 ^
      |                                 ;
   26 |             //if(d<-1)flg*=0;
   27 |             if(i==N-1&&d<-1)flg*=0;
      |             ~~
Language: C

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using Pair = pair<int, int>;
using Vec = vector<int>;
using Graph = vector<Vec>;

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


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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


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

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.StringTokenizer;
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Solve1 {
	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)),true);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.flush();
		out.close();
	}
}

class TaskB {
    public void solve(int testNumber, InputReader in, PrintWriter pw) {
    	int n=in.nextInt();
    	int arr[]=new int[n];
    	for(int i=0;i<n;i++) {
    		arr[i]=in.nextInt();
    	}
    	boolean flag=true;
    	int temp=arr[0];
    	int max=arr[0];
    	for(int i=1;i<n;i++) {
    		if(arr[i]<temp-1||arr[i]<max) {
    			flag=false;
    			break;
    		}
    		max=temp-1>max?temp-1:max;
    		temp=arr[i];
    	}
    	if(flag) {
    		pw.println("Yes");
    	}else {
    		pw.println("No");
    	}
    	
    		
    	}
}
class Pair<A,B>{
	A first;
	B second;
	Pair(A first,B second){
		this.first=first;
		this.second=second;
	}
}


class InputReader{
    BufferedReader br;
    StringTokenizer st;
    public InputReader(InputStream in){
        br=new BufferedReader(new InputStreamReader(in));
        st=null;
    }
    public String next(){
    while(st==null||!st.hasMoreTokens()){
        try{
            st=new StringTokenizer(br.readLine());
        }catch(IOException e){
            throw new RuntimeException(e);
        }
    }
   return st.nextToken();
    }
    public int nextInt(){
        return Integer.parseInt(next());
    }
    public long nextLong() {
    	return Long.parseLong(next());
    }
}


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

#define rep(i,a,b) for(int i=(a); i<(b); i++)
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
ll gcd(ll a, ll b){if (a%b == 0)  return(b);else  return(gcd(b, a%b));}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}
/* map<string,int> */
/* 大文字を小文字に変換 tolower*/
/* 小文字を大文字に変換 toupper*/
/* 辞書順 next_permutation(a.begin(),a.end()) */
 
int main() {
    int n;
    cin >> n;
    vector <ll> h(n);
    rep(i,0,n){
        cin >> h[i];
    }
    rep(i,0,n-1){
        if (h[i] > h[i+1]) {
            h[i]--;
        }
        if (i >0) {
            if (h[i] > h[i+1] || h[i] < h[i-1]) {
                no
                return 0;
            }
        }
    }
    yes

}

Compiler output:
a.cc:6:1: error: 'll' does not name a type
    6 | ll gcd(ll a, ll b){if (a%b == 0)  return(b);else  return(gcd(b, a%b));}
      | ^~
a.cc:7:1: error: 'll' does not name a type
    7 | ll lcm(ll a, ll b){return a * b / gcd(a, b);}
      | ^~
a.cc: In function 'int main()':
a.cc:15:5: error: 'cin' was not declared in this scope
   15 |     cin >> n;
      |     ^~~
a.cc:16:5: error: 'vector' was not declared in this scope
   16 |     vector <ll> h(n);
      |     ^~~~~~
a.cc:16:13: error: 'll' was not declared in this scope
   16 |     vector <ll> h(n);
      |             ^~
a.cc:16:17: error: 'h' was not declared in this scope
   16 |     vector <ll> h(n);
      |                 ^
a.cc:5:12: error: 'cout' was not declared in this scope
    5 | #define no cout << "No" << endl;
      |            ^~~~
a.cc:26:17: note: in expansion of macro 'no'
   26 |                 no
      |                 ^~
a.cc:5:28: error: 'endl' was not declared in this scope
    5 | #define no cout << "No" << endl;
      |                            ^~~~
a.cc:26:17: note: in expansion of macro 'no'
   26 |                 no
      |                 ^~
a.cc:4:13: error: 'cout' was not declared in this scope
    4 | #define yes cout << "Yes" << endl;
      |             ^~~~
a.cc:31:5: note: in expansion of macro 'yes'
   31 |     yes
      |     ^~~
a.cc:4:30: error: 'endl' was not declared in this scope
    4 | #define yes cout << "Yes" << endl;
      |                              ^~~~
a.cc:31:5: note: in expansion of macro 'yes'
   31 |     yes
      |     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
int main() {
  ll n; cin>>n;
  vector<ll> a(n);
  rep(i, n) cin>>a.at(i);
  bool ans=true;
  bool x=true;
  ll m;
  rep(i, n-1){
    if(a.at(i)-a.at(i+1)>=2) ans=false;
    if(a.at(i)-a.at(i+1)==1) {
      x=false;
      m=i;
      break;
    }
  }
  if(x==false) {
  for(m; m<n; m++) {
    if(a.at(i)-a.at(i+1)>=1) ans=false;
  }
  }
    
  if(ans==false) cout<< "No" << endl;
  else cout << "Yes" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: error: 'i' was not declared in this scope
   22 |     if(a.at(i)-a.at(i+1)>=1) ans=false;
      |             ^
Language: C++

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

int main(){
 
  long long N, i;
  cin >> N;
  vector<long long> H(N);
  for(i = 0; i < N; i++) cin >> H.at(i);
  
  for(i = 0; i < N - 1; i++){
    
    if(H.at(i) > H.at(i + 1)) H.at(i)--;
    if(H.at(i) > H.at(i + 1) || ((i != 0 || i != N - 2) && (H.at(i) > H.at(i + 1) || H.at(i - 1) > H.at(i))){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:109: error: expected ')' before '{' token
   14 |     if(H.at(i) > H.at(i + 1) || ((i != 0 || i != N - 2) && (H.at(i) > H.at(i + 1) || H.at(i - 1) > H.at(i))){
      |       ~                                                                                                     ^
      |                                                                                                             )
a.cc:18:3: error: expected primary-expression before '}' token
   18 |   }
      |   ^
Language: C

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

int main()
{
	int i, N, H[100001];
	scanf("%d", &N);
	for (i = 1; i <= N; i++) scanf("%d", &(H[i]));
	
	int flag = 1;
	for (i = 1, h[0] = 0; i <= N; i++) {
		if (h[i] > h[i-1]) h[i]--;
		else if (h[i] < h[i-1]) flag = 0;
	}
	
	if (flag == 1) printf("Yes\n");
	else printf("No\n");
	fflush(stdout);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:21: error: 'h' undeclared (first use in this function)
   11 |         for (i = 1, h[0] = 0; i <= N; i++) {
      |                     ^
main.c:11:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

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

Compiler output:
a.cc:24:16: warning: missing terminating " character
   24 |     else cout<<"No;
      |                ^
a.cc:24:16: error: missing terminating " character
   24 |     else cout<<"No;
      |                ^~~~
a.cc: In function 'int main()':
a.cc:27:1: error: expected primary-expression before '}' token
   27 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;

#define rep(i, n) for(int i=0;i<(int)n;i++)
#define rep2(i, s, n) for(int i=(s);i<(int)n;i++)
int INF=1e9+7;

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

Compiler output:
a.cc:14:12: error: macro "rep" passed 3 arguments, but takes just 2
   14 |   rep(i,0,N) cin >> H[i];
      |            ^
a.cc:6:9: note: macro "rep" defined here
    6 | #define rep(i, n) for(int i=0;i<(int)n;i++)
      |         ^~~
a.cc:16:14: error: macro "rep" passed 3 arguments, but takes just 2
   16 |   rep(i,0,N-1) {
      |              ^
a.cc:6:9: note: macro "rep" defined here
    6 | #define rep(i, n) for(int i=0;i<(int)n;i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:14:3: error: 'rep' was not declared in this scope
   14 |   rep(i,0,N) cin >> H[i];
      |   ^~~
a.cc:16:6: error: expected ';' before '{' token
   16 |   rep(i,0,N-1) {
      |      ^         ~
      |      ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char>cvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
int main()	{
  int n;
  cin>>n;
  vector<int>h(n);
  rep(i,n) cin>>h[i];
  int cm=-1;
  rep(i,n){
    if(cm<=a[i]-1){
      cm=a[i]-1;
    }
    else if(cm<=a[i])
      cm=a[i];
    else{
      cout<<"No"<<endl;
      return 0;
    }
  }
  cout<<"Yes"<<endl;
}

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

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef long long ll;

int main()
{
	int N;
	scanf("%d", &N);
	long h[N];
	int i = 0;
	while (i < N)
	{
		scanf("%ld", &h[i]);
		// printf("%ld ", h[i]);
		i++;
	}
	i = 0;
	while (i < N - 1)
	{
		if (h[i]- h[i+1] >= 2)
		{
			printf("No"); return 0;
		}
		if (h[i] - h[i+1] == 1)
		{
			if (i != 0 && i != N - 2 && h[i] >= h[i - 1])
			{
				printf("No"); return 0;
			}
		}

Compiler output:
main.c: In function 'main':
main.c:31:17: error: expected declaration or statement at end of input
   31 |                 }
      |                 ^
main.c:31:17: error: expected declaration or statement at end of input
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define lld long long int
#define M 1000000007
#define fors(i,n) for(int i=0;i<n;++i)
#define fore(i,a,b) for(int i=a;i<=b;++i)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define vv vector<int>
#define endl "\n"
#define test(i) cout<<i<<endl
#define tests(i) cout<<"i: "<<i<<endl;
#define itrt int t; cin>>t; fors(i,t)
#define itr1 int t; cin>>t;
#define ff first
#define ss second
#define pb push_back
#define vmp make_pair
#define ppb pop_back
#define sorta(a,n) sort(arr,arr+n)
#define sortv(x) sort(x.begin(),x.end())
void file(){
    #ifdef LOCAL
    freopen("demo.in","r",stdin);
    freopen("demo.out","w",stdout);
    #endif
}
bool sortdes(const pair<int,int> &a, const pair<int,int> &b){return a.ss<b.ss;}
bool sortasc(const pair<int,int> &a, const pair<int,int> &b){return a.ss>b.ss;} 
int gcd(int x,int y){return __gcd(x,y);}
// lld fact(lld n);
// lld nCr(lld n,lld r){return fact(n) / (fact(r) * fact(n - r));}
// lld fact(lld n){ lld res = 1; for(lld i = 2; i <= n; i++){res = res * i;}return res;} 
// const int maxi = 1e6+10;
// vector<int> v[maxi];
// long long a[maxi];
// void dfs(int x,int y){
//     a[x]+=a[y];
//     for(int i:v[x]){
//         if(i!=y){
//             dfs(i,x);
//         }
//     }
// }

void test_case(){
    int n;
    cin>>n;
    vv v(n);
    for(int i=0;i<n;++i){
        cin>>v[i];
    }
    int flag=1;
    for(int i=1;i<n-1;++i){
        if(v[i]>v[i-1]+1 || v[i]+1<v[i+1] || v[i]+1>v[i+1] v[i-1]>v[i]+1){
            flag=0;
            break;
        }
    }
    if(flag){
        cout<<"Yes";
    }
    else{
        cout<<"No";
    }
}

int main(){
    fastio;
    file();
    int T=1;
    // int T;
    // cin>>T;
    for(int nr=1;nr<=T;++nr) {
        // cout<<"Case #"<<nr<<": ";
		test_case();
    }
}

Compiler output:
a.cc: In function 'void test_case()':
a.cc:54:59: error: expected ')' before 'v'
   54 |         if(v[i]>v[i-1]+1 || v[i]+1<v[i+1] || v[i]+1>v[i+1] v[i-1]>v[i]+1){
      |           ~                                               ^~
      |                                                           )
Language: C++

int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	for (;;) {
		c -= b;
		if (c <= 0) {
			cout << "Yes" << endl;
			return 0;
		}
		a -= d;
		if (a <= 0) {
			cout << "No" << endl;
			return 0;
		}
 
	}
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> a >> b >> c >> d;
      |         ^~~
a.cc:7:25: error: 'cout' was not declared in this scope
    7 |                         cout << "Yes" << endl;
      |                         ^~~~
a.cc:7:42: error: 'endl' was not declared in this scope
    7 |                         cout << "Yes" << endl;
      |                                          ^~~~
a.cc:12:25: error: 'cout' was not declared in this scope
   12 |                         cout << "No" << endl;
      |                         ^~~~
a.cc:12:41: error: 'endl' was not declared in this scope
   12 |                         cout << "No" << endl;
      |                                         ^~~~
Language: C++

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

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

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

int main()
{
  ll N;cin>>N;
  vector<ll> H(N+2);
  for (ll i=1;i<=N;i++)
    cin>>H[i];
  H[N+1]=pow(10,9)+1;
  
  for (ll i=1;i<=N;i++)
  {
    if (H[i+1]-H[i]==-1)
      H[i]-=1;
    else if (H[i]-H[i-1]==1 && i>=2 && H[i]H[i+1])
      H[i]-=1;
  }
  
  for (ll i=1;i<=N;i++)
    cout<<"H["<<i<<"]="<<H[i]<<endl;
  
  for (ll i=1;i<=N;i++)
  {
    if (H[i+1]-H[i]<0)
    {
      cout<<"No"<<endl;
      return (0);
    } 
  }
  cout<<"Yes"<<endl; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:44: error: expected ')' before 'H'
   17 |     else if (H[i]-H[i-1]==1 && i>=2 && H[i]H[i+1])
      |             ~                              ^
      |                                            )
Language: C++

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

int main(){
  ll n;
  cin >> n;
  vector<ll> a(n+10);
  int ans = 0;
  rep(i,n) cin >> a[i];
  rep(i,n-1){
    if(a[i] > a[i+1]){
      --a[i];
      break;
  }
  rep(i,n-1){
    if(a[i] > a[i+1]){
      ++a[i];
      ++a[i+1];
      break;
    }
  }
  rep(i,n-1){
    if(a[i] > a[i+1]){
      puts("No");
      return 0;
    }
  }
  puts("Yes");
  return 0;
}


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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: expected ';' before '}' token
   13 |       pre=h[i]-1
      |                 ^
      |                 ;
   14 |     }
      |     ~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'else' without a previous 'if'
   15 |     else puts("No");
      |     ^~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'else' without a previous 'if'
   16 |   else {
      |   ^~~~
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:34:1: error: expected declaration or statement at end of input
   34 | }
      | ^
main.c:34:1: error: expected declaration or statement at end of input
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:34:1: error: expected declaration or statement at end of input
   34 | }
      | ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:33:1: error: expected declaration or statement at end of input
   33 | }
      | ^
main.c:33:1: error: expected declaration or statement at end of input
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:33:1: error: expected declaration or statement at end of input
   33 | }
      | ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:16:13: error: 'j' undeclared (first use in this function)
   16 |    if(max<b[j]) max=b[j];
      |             ^
main.c:16:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:1: error: expected declaration or statement at end of input
   33 | }
      | ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:12:22: error: expected ';' before 'if'
   12 |   {scanf("%d ",&b[i])
      |                      ^
      |                      ;
   13 |   if(b[i-1]+1<=b[i])  c=c+1;
      |   ~~
Language: C++

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


int main(){
int n;
cin >> n;
vector<int>h(n);
rep(i,n) cin >> h[i];

int count1 = 0 , count2=0;
rep(i,n-1){
  if(h[i+1]>=h[i]) ++count1;}

if (count1 == n-2){
    rep(i,n-1){
        if(h[i+1]<h[i]){h[i]-=1;
        }
    }
    rep(i,n-1){
  if(h[i+1]>=h[i]) ++count2;}
    
}
if (count==n-1||count==n-2) count2 =3;
if ((count1 == n-1 )||(count2 == n-1)) cout <<"Yes" << endl;
else cout <<"No" << endl;
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:27:10: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator=='
   27 | if (count==n-1||count==n-2) count2 =3;
      |     ~~~~~^~~~~
a.cc:27:22: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator=='
   27 | if (count==n-1||count==n-2) count2 =3;
      |                 ~~~~~^~~~~
Language: C++

n = gets.to_i
h = gets.split(' ').map(&:to_i)
count = 0
(n-1).times do |i|
	if h[i] > h[i + 1]
		count += 1
	end
	count += 10 if (h[i] - h[i+1]) > 1
end

if count < 2
	puts 'Yes'
else
	puts 'No'
end

Compiler output:
a.cc:12:14: warning: multi-character character constant [-Wmultichar]
   12 |         puts 'Yes'
      |              ^~~~~
a.cc:14:14: warning: multi-character character constant [-Wmultichar]
   14 |         puts 'No'
      |              ^~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n = gets.to_i
      | ^
Language: C++

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

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: lvalue required as left operand of assignment
   14 |   if(H.at(i)-H.at(i-1)=-1)
      |      ~~~~~~~^~~~~~~~~~
Language: C

#include <stdio.h>

int	main(void)
{
  	int	n;
  	long long	h[100000];
  	long long	d[100000];
  	int	i;
  	int cnt;
  	int flag;
  	
  	scanf("%d", &n);
  	for(i=0; i<n; i++)
    {
      	scanf("%lld", &h[i]);
    }
  
  	cnt = 0;
  	for(i=0; i<n-1; i++)
    {
      	d[i] = h[i] - h[i+1];
      	if (d[i] > 0)
          	cnt++;
    }
    
    flag = 0;
    for(i=0; i<n-1; i++)
    {
        if(h[i] != h[0])
            flag = 1;
        if(h[i] != h[0] + 1)
            flag = 1
    }
    if(flag == 0)
    {
        printf("Yes");
        return (0);
    }
    
    flag = 0;
    for(i=0; i<n-1; i++)
    {
        if(h[i] != h[0])
            flag = 1;
        if(h[i] != h[0] - 1)
            flag = 1;
    }
    if(flag == 0)
    {
        printf("Yes");
        return (0);
    }
    
  	if (cnt == 2)
    {
      	for(i=0; i<n-1; i++)
        {
          	if(d[i] > 1)
          	{
          	    if(d[i+1] == 1)
              	printf("No");
              	return (0);
          	}
        }
      	printf("No");
      	return (0);
    }
  
  	if (cnt == 1)
    {
      	for(i=0; i<n-1; i++)
        {
          	if(d[i] > 1)
          	{
              	printf("No");
              	return (0);
          	}
        }
        printf("Yes");
        return (0);
    }
  	
  	if (cnt < 1)
    {
      	printf("Yes");
      	return (0);
    }
  	return (0);
}

Compiler output:
main.c: In function 'main':
main.c:32:21: error: expected ';' before '}' token
   32 |             flag = 1
      |                     ^
      |                     ;
   33 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
#define rep(i, n) for (int i = 0; i < n; ++i)
using ll = long long;
using namespace std;
#define P pair<int, int>
int main () {
    ll n;
    cin >> n ;
    ll h ;

    rep(i,n) {
        cin >> h;
        if (rev+1 <= h) h--;
 
        if (rev > h) {
            cout << "No" << endl;
            return 0;
        }
 
        rev = h;
    }
    cout << "Yes" << endl;

    return 0 ;
}

 


Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'rev' was not declared in this scope; did you mean 'rep'?
   19 |         if (rev+1 <= h) h--;
      |             ^~~
      |             rep
a.cc:21:13: error: 'rev' was not declared in this scope; did you mean 'rep'?
   21 |         if (rev > h) {
      |             ^~~
      |             rep
a.cc:26:9: error: 'rev' was not declared in this scope; did you mean 'rep'?
   26 |         rev = h;
      |         ^~~
      |         rep
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:7:15: error: invalid operands to binary & (have 'char *' and 'int')
    7 |     scanf("%d"&a[i]);
      |           ~~~~^~~~~
      |           |     |
      |           |     int
      |           char *
Language: C

#include<stdio.h>
int main(void){
int n;
  scanf("%d",&n);
  long a[n];
  for(int i=0;i<n;i++){
	scanf("%ld",&a[i]);
  }
  
  for(int i=n-1;i>0;i--){
	if(a[i-1]-a[i]>=2){
      printf("No");
      return 0;
    }
  }
  printf("Yes");
  return 0;


Compiler output:
main.c: In function 'main':
main.c:17:3: error: expected declaration or statement at end of input
   17 |   return 0;
      |   ^~~~~~
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long H[] = new long[N];
    for(int i=0;i<N;i++){
      H[i]=sc.nextLong();
    }
    int reCnt=0;
    for(int i=0;i<N-1;i++){
      if(H[i]-H[i+1]>1){
        System.out.println("No");
        return;
        
      }else if(H[i]-H[i+1]==1){
        reCnt++;
        if(reCnt==2){
          System.out.println("No");
          return
        }
      }else if(H[i]-H[i+1]==-1){
        reCnt=Math.max(reCnt-1,0);
      }else{
        continue;
      }
    }
    if(reCnt>1){
      System.out.println("No");
    }else{
      System.out.println("Yes");
    }
      
  }
  

  
}


Compiler output:
Main.java:21: error: illegal start of expression
        }
        ^
1 error
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long H[] = new long[N];
    for(int i=0;i<N;i++){
      H[i]=sc.nextLong();
    }
    int reCnt=0;
    for(int i=0;i<N-1;i++){
      if(H[i]-H[i+1]>1){
        System.out.println("No");
        return;
        
      }else if(H[i]-H[i+1]==1){
        reCnt++;
        if(reCnt==2){
          System.out.println("No");
          return
      }else if(H[i]-H[i+1]==-1){
        reCnt=Math.max(reCnt-1,0);
      }else{
        continue;
      }
    }
    if(reCnt>1){
      System.out.println("No");
    }else{
      System.out.println("Yes");
    }
      
  }
  

  
}


Compiler output:
Main.java:21: error: illegal start of expression
      }else if(H[i]-H[i+1]==-1){
      ^
Main.java:37: error: reached end of file while parsing
}
 ^
2 errors
Language: C++


#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;
// << fixed << setprecision(0) <<
// sort(ALL(),greater<int>());

int main() {
ll n;
cin >> n;
string ans="Yes";
ll h[n];
REP(i,n) cin >>h[i];
for(int i=n-1;i>0;j--) {
  if(h[i-1]-h[i]>0) h[i-1]--;
  if(h[i-1]-h[i]>1) ans="No"; 
}
cout << ans << endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:19: error: 'j' was not declared in this scope
   20 | for(int i=n-1;i>0;j--) {
      |                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
using ll = long long ;
using ld=long double;


int main(){
    int n;
    cin>>n;
    vector<ll> h(n);
    int flag=0;
    for(int i=0;i<n;i++)
    cin>>h[i];
    int x=h[n-1];
    for(int i=n-2;i>0;i--){
        if(h[i]>x+1){
            flag=1;
            break;
        }
        x=min(h[i],x);
    }
    if(flag==1)
    cout<<"No";
    else
    cout<<"Yes";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: no matching function for call to 'min(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&, int&)'
   21 |         x=min(h[i],x);
      |           ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/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:21:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   21 |         x=min(h[i],x);
      |           ~~~^~~~~~~~
/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:21:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   21 |         x=min(h[i],x);
      |           ~~~^~~~~~~~
Language: C++

#include<stdio.h>
int main() {
  //変数n,hを定義
  int n,h[n];
  scanf("%d%d",&n,&h[n]);
  int x = 0;
    while(x<n){
      if(h[i]<=h[i+1]){
        i++;}
        else if(h[i]-1<=h[i+1] && h[i-1]<=h[i]-1){
        i++;}
    }
  if(x == n-1){
    printf("%s\n","Yes");}
  else{
    printf("%s\n","No");}
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'i' was not declared in this scope
    8 |       if(h[i]<=h[i+1]){
      |            ^
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] height = new int[n];
    for(int i = 0 ; i < n ; i++){
      height[i] = Integer.parseInt(sc.next());
    }

    boolean pos = true;
    for(int i = 0 ; i < n - 1; i++){
     if(height[n - i - 2] - height[n - i - 1] <= 0){
       continue;
     }else if(height[n - i - 2] - height[n - i - 1] == 1){
       height[n - i - 2]--;
     }else{
       bl = false;
       break;
     }
    }
    if(pos){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}


Compiler output:
Main.java:18: error: cannot find symbol
       bl = false;
       ^
  symbol:   variable bl
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
	
	int n;
	
	cin >> n;
	
	int a[n];
	
	for (int i = 0; i < n; i++){
		
		cin >> a[i];
		
	}
	
	bool ans = true;
	
	for (int i = 0; i < n-1; i++){
		if (a[i] < a[i+1]){
			a[i+1]--;
		}
	}
	
	for (int i = 0; i < n-1; i++){
		if (a[i] > a[i+1]){
			ans = false;
		}
	}1
	
	if (ans){
		cout << "YES";
	} else {
		cout << "NO";
	}
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:11: error: expected ';' before 'if'
   31 |         }1
      |           ^
      |           ;
   32 | 
   33 |         if (ans){
      |         ~~ 
a.cc:35:11: error: 'else' without a previous 'if'
   35 |         } else {
      |           ^~~~
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] stairs = new int[n];
    boolean bl = true;
    for(int i = 0; i< n; i++){
      stairs[i] = sc.nextInt();
    }
    if(n != 1){
      for(int i = 0; i < n - 1; i++){
        if(i == 0){
          if(stairs[0] - stairs[1] >= 2){
            bl = false;
            break;
          }
        }else if(stairs[i] - stairs[i + 1] >= 2 || (stairs[i] == stairs[i - 1] && stairs[i] > stairs[i + 1])){
          bl = false;
          break;
        }else(stairs[i] > stairs[i + 1]){
        stairs[i]--;
        }
      }
    }
    if(bl)System.out.println("Yes");
    else{
      System.out.println("No");
    }
  }
}

Compiler output:
Main.java:21: error: not a statement
        }else(stairs[i] > stairs[i + 1]){
             ^
Main.java:21: error: ';' expected
        }else(stairs[i] > stairs[i + 1]){
                                        ^
2 errors
Language: Java

import java.util.*;

public class Main1
 { 

	public static void main(String[] args) 
	{ 
		
			 
			int a,i;
			String t="Yes";
			Scanner s2 = new Scanner(System.in);
	    		a= s2.nextInt();
			int b[]=new int[a];
			for(i=0;i<b.length ;i++)
			{
				b[i]=s2.nextInt();
				
			}
			for(i=0;i<b.length-1 ;i++)
			{

				if(b[i]<b[i+1])
				{	b[i+1]--;
					t="Yes";
				}
				else
				{
					t="No";
				}		
			}
		System.out.println(t);
	}

}	

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

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

    }
    int ans=1;
    for(int i=0;i<n;i++)
    {
    if(h[i+1]>h[i])    --h[i+1] ;
    else if (h[i+1]<h[i]) 
    ans=0;
    }
    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: expected initializer before 'for'
    8 |     for(int i=0;i<n;i++)
      |     ^~~
a.cc:8:17: error: 'i' was not declared in this scope
    8 |     for(int i=0;i<n;i++)
      |                 ^
a.cc:16:8: error: 'h' was not declared in this scope
   16 |     if(h[i+1]>h[i])    --h[i+1] ;
      |        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int no_ofheight;
    cin>>no_ofheight;
    int heights[no_ofheight];
    for(int i=0;i<no_ofheight; i++){
        cin>>heights[i];
    }
    int ans_assume=1;
    for(int i=0;i<no_ofheight-1;i++){
        if(heights[i+1]>heights[i]){
            //false
            --heights[i+1];

        }
        else if(heights[i+1]<ehights[i]){
             ans_assume=0;
        }
    }
    if(ans_assume==1){
        cout<<"Yes"<<endl;

    }
    else
    {
        cout<<"No"<<endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:30: error: 'ehights' was not declared in this scope; did you mean 'heights'?
   18 |         else if(heights[i+1]<ehights[i]){
      |                              ^~~~~~~
      |                              heights
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>

#define endl '\n'
#define fi first
#define se second
#define pb push_back
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
const int MOD = 1e9 + 7;
const int maxn = 1e6 + 5;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-8;

int main() {
    int n;
    cin >> n;
    vector<int> nums;
    for(int i = 0; i < n; ++i){
        int x; cin >> x;
        nums.push_back(x);
    }
    bool flag = true;
    for(int i = n - 2; i >= 0; i--){
        if(nums[i] > (nums[i + 1] + 1)) {flag = false; break;}
        if(nums[i] == nums[i + 1] + 1) nums[i]--;4
1 3 2 1
    }
    if(flag == true) cout << "Yes" << endl;
    else cout << "No" << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:51: error: expected ';' before numeric constant
   34 |         if(nums[i] == nums[i + 1] + 1) nums[i]--;4
      |                                                   ^
      |                                                   ;
   35 | 1 3 2 1
      | ~
Language: C++

#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
using namespace std;
int main(){
  int n;
  cin>>n;
  V<int> h(n);
  fo(i,n){
    cin>>h[i];
  }
  int a=1;
  for(int i=1; i<n; i++){
    if(h[i]<h[i-1]){
      if(h[i-1]-h[i]>1){
        a=0;
        break;
      }
      else
        h[i]++;
    }
  }
 
  if(a)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'V' was not declared in this scope
    9 |   V<int> h(n);
      |   ^
a.cc:9:5: error: expected primary-expression before 'int'
    9 |   V<int> h(n);
      |     ^~~
a.cc:10:6: error: 'i' was not declared in this scope
   10 |   fo(i,n){
      |      ^
a.cc:10:3: error: 'fo' was not declared in this scope
   10 |   fo(i,n){
      |   ^~
a.cc:15:8: error: 'h' was not declared in this scope
   15 |     if(h[i]<h[i-1]){
      |        ^
Language: C++

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

int main()
{
    int N;
    cin >> N;
    vector<int>V(N);

    for (int j = 0; j < N; j++)
    {
        cin >> V[j];
    }
  int flag = 1 ;
    for (int j = 0; j < N-1; j++)
    {
        if (V[j] < V[j-1])
        {
          if(V[j-1] - V[j] == 1)
          {
            flag = 0;
          }
            
        }
        else
        {
            V[j]++;
        }
    }
  if(flag)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
    

Compiler output:
a.cc: In function 'int main()':
a.cc:36:22: error: expected '}' at end of input
   36 |     cout<<"No"<<endl;
      |                      ^
a.cc:8:1: note: to match this '{'
    8 | {
      | ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i < n; ++i)
#define repe(i, n) for(int i=0; i <= n; ++i)
#define repr(i, n) for(int i=n-1; i > 0; --i)
#define all(x) (x).begin(), (x).end()
#define pb(x) push_back(x)
#define eb(x,y) emplace_back(x,y)
#define PI 3.14159265359
using namespace std;
template <class T> bool chmax(T &a, const T &b) {if (a<b) {a = b; return 1;} return 0;}
template <class T> bool chmin(T &a, const T &b) {if (b<a) {a = b; return 1;} return 0;}
template <class T> using V=vector<T>;
typedef long long ll;
const int INF = 1e9;
const ll MOD = 1000000007;
const ll MAX = 510000;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
vector<int> Eratosthenes(const int N)
{
    vector<bool> is_prime(N+1, true);
    vector<int> P;
    for(int i=2; i<=N; i++) {
        if (is_prime[i]) {
            for(int j=2*i; j<=N; j+=i) {
                is_prime[j] = false;
            }
            P.emplace_back(i);
        }
    }
    return P;
}
 
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    vector<ll> h(n);
    rep(i,n) {
        cin >> h[i];
    }
    if (n==1) {
        cout << "Yes" << "\n";
        return 0;
    }
    bool j = true;
    for(int i=0; i<n-1; i++) {
        if ((h[i]<=h[i+1] || h[i]-1<=h[i+1]) && (h[n-1] >= h[0] || h[0]-1 <= h[n-1]) {
            continue;
        } else {
            cout << "No" << "\n";
            return 0;
        }  
    }
    cout << "Yes" << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:85: error: expected ')' before '{' token
   67 |         if ((h[i]<=h[i+1] || h[i]-1<=h[i+1]) && (h[n-1] >= h[0] || h[0]-1 <= h[n-1]) {
      |            ~                                                                        ^~
      |                                                                                     )
a.cc:73:5: error: expected primary-expression before '}' token
   73 |     }
      |     ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:25:8: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   25 |       a[i + 1]++;
      |        ^