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

#include<bits/stdc++.h>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: 'flag' was not declared in this scope
   20 |     if( H[i] > H[i+1]){ flag = false;}}
      |                         ^~~~
a.cc:22:7: error: 'flag' was not declared in this scope
   22 |   if( flag){ cout << "Yes" << endl;}
      |       ^~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'vecotr' was not declared in this scope
    9 |   vecotr<int> a(n);
      |   ^~~~~~
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vecotr<int> a(n);
      |          ^~~
a.cc:10:19: error: 'a' was not declared in this scope
   10 |   rep(i,n) cin >> a[i];
      |                   ^
a.cc:13:16: error: 'a' was not declared in this scope
   13 |     if (pre <= a[i]-1) {
      |                ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:24:38: error: lvalue required as left operand of assignment
   24 |             else if (H.at(N - s - 1) - H.at(N - s) = 1)
      |                      ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> n;
      |     ^~~
a.cc:5:9: error: 'cout' was not declared in this scope
    5 |         cout << "Yes" << endl;
      |         ^~~~
a.cc:5:26: error: 'endl' was not declared in this scope
    5 |         cout << "Yes" << endl;
      |                          ^~~~
a.cc:14:12: error: 'max' was not declared in this scope
   14 |     h[0] = max(h[0]-1, 1);
      |            ^~~
a.cc:22:13: error: 'cout' was not declared in this scope
   22 |             cout << "No" << endl;
      |             ^~~~
a.cc:22:29: error: 'endl' was not declared in this scope
   22 |             cout << "No" << endl;
      |                             ^~~~
a.cc:27:5: error: 'cout' was not declared in this scope
   27 |     cout << "Yes" << endl;
      |     ^~~~
a.cc:27:22: error: 'endl' was not declared in this scope
   27 |     cout << "Yes" << endl;
      |                      ^~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: expected primary-expression before ')' token
   11 |             if(maxv-h[i]>=){
      |                           ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <utility>
using namespace std;
typedef long long int ll;

int main() {
  int N;
  cin>>N;
  
  vector<ll> h(N);
  for(int i=0;i<N;++i){
    cin>>h[i];
  }
  
  bool flag=ture;
  
  for(int i=0;i<N-1;++i){
    if(h[i]-h[i+1]>=2)
      flag=false;
  }
  
  if(N==1)
    flag=true;
  
  if(flag)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}


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

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

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

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

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;

int main()
{
   int N;
   cin >> N;
   vector<int> H(N);
   for(int i=0;i<N;++i) cin >> H[i];

   bool judge=true;

   reverse(H.begin(),H.end());
   for(int i=0;i<N;++i){
      if(H[i]-H[i+1] < -1){
         else cout << "No" << endl;
         return 0;
      }
      else if(H[i]-H[i+1]==-1) H[i+1]--;
   }
   if(judge) cout << "Yes" << endl;


   return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: expected '}' before 'else'
   20 |          else cout << "No" << endl;
      |          ^~~~
a.cc:19:27: note: to match this '{'
   19 |       if(H[i]-H[i+1] < -1){
      |                           ^
a.cc:23:7: error: 'else' without a previous 'if'
   23 |       else if(H[i]-H[i+1]==-1) H[i+1]--;
      |       ^~~~
a.cc:23:17: error: 'i' was not declared in this scope
   23 |       else if(H[i]-H[i+1]==-1) H[i+1]--;
      |                 ^
a.cc: At global scope:
a.cc:25:4: error: expected unqualified-id before 'if'
   25 |    if(judge) cout << "Yes" << endl;
      |    ^~
a.cc:28:4: error: expected unqualified-id before 'return'
   28 |    return 0;
      |    ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

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

const int nax = 1e5 + 5;
long long a[nax];

int main() {
 int n; cin >> n;
 for(int i=0; i<n; ++i) cin >> a[i];
 int flag = 0, mx = 0;
 for(int i=0; i+1<n; ++i) {
   if(a[i] - a[i+1] == 0) {
     if(a[i] <= mx) 
       break;
     int p = i, t = a[i];
     while(p < n && a[p] == t ) {
        --a[p];
        ++p;
     }
     i = p-1;
     continue;
   }
   mx = max(mx, a[i]);
 }
 for(int i=0; i+1<n; ++i) {
  if(a[i]-a[i+1] > 1) {
    cout << "No\n";
    return 0;
  }
  if(a[i] - a[i+1] > 0)
    --a[i];
 }
 //for(int i=0; i<n; ++i)
  // cout << a[i] << " ";
// cout << "\n";
 for(int i=0; i+1 < n; ++i) {
//   cout << "a[i]: " << a[i] << " ";
   if(a[i] - a[i+1] >= 1) {
      cout << "No\n";
      return 0;
   }
 }
 cout << "Yes\n";
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: no matching function for call to 'max(int&, long long int&)'
   23 |    mx = max(mx, a[i]);
      |         ~~~^~~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:23:12: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   23 |    mx = max(mx, a[i]);
      |         ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303: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:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:23:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   23 |    mx = max(mx, a[i]);
      |         ~~~^~~~~~~~~~
Language: C++

n = int(input())
H = list(map(int, input().split()))
f = 0
if n == 1:
    f = 0
elif n == 2:
    if abs(H[0] - H[1]) <= 1:
        f = 0
    else:
        f = 1
else:
	H[0]-=1
    for i in range(n-1):
        if H[i+1] > H[i]:
            H[i+1] -= 1
        else:
			f = 1			

if f == 0:
    print("Yes")
else:
    print("No")

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> data(N);
  for (int i = 1; i < N; i++) {
    cin >> data.at(i);
  }
  bool ans = false;
  
  for (int i = 1; i < (N-2); i++) {
  if ((data.at(i) >= (data.at(i+1) + 1) && (data.at(i+1) >= (data.at(i+2) + 1)) 
     ans = true;
  }  
  if (data.at(i) >= (data.at(i+1) + 2)) 
     ans = true;
  }
}
  if (ans) {
    cout << "No" << endl;
  }
  else {
    cout << "Yes" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:80: error: expected ')' before 'ans'
   14 |   if ((data.at(i) >= (data.at(i+1) + 1) && (data.at(i+1) >= (data.at(i+2) + 1))
      |       ~                                                                        ^
      |                                                                                )
   15 |      ans = true;
      |      ~~~                                                                        
a.cc:15:16: error: expected ')' before ';' token
   15 |      ans = true;
      |                ^
      |                )
a.cc:14:6: note: to match this '('
   14 |   if ((data.at(i) >= (data.at(i+1) + 1) && (data.at(i+1) >= (data.at(i+2) + 1))
      |      ^
a.cc:17:15: error: 'i' was not declared in this scope
   17 |   if (data.at(i) >= (data.at(i+1) + 2))
      |               ^
a.cc: At global scope:
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
a.cc:21:3: error: expected unqualified-id before 'if'
   21 |   if (ans) {
      |   ^~
a.cc:24:3: error: expected unqualified-id before 'else'
   24 |   else {
      |   ^~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:14:21: error: expected expression before ';' token
   14 |  if(sa[i-2]>=2){a=a+;}
      |                     ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> data(N);
  for (int i = 1; i < N; i++) {
    cin >> data.at(i);
  }
  bool ans = false;
  
  for (int i = 1; i < (N-2); i++) {
  if ((data.at(i) >= (data.at(i+1) + 1) && (data.at(i+1) >= (data.at(i+2) + 1)) 
     )ans = true
  }  
  if ((data.at(i) >= (data.at(i+1) + 2)) 
     ans = true;
}
  if (ans) {
    cout << "No" << endl;
  }
  else {
    cout << "Yes" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: expected ')' before 'ans'
   15 |      )ans = true
      |       ^~~
      |       )
a.cc:14:6: note: to match this '('
   14 |   if ((data.at(i) >= (data.at(i+1) + 1) && (data.at(i+1) >= (data.at(i+2) + 1))
      |      ^
a.cc:16:3: error: expected primary-expression before '}' token
   16 |   }
      |   ^
a.cc:17:16: error: 'i' was not declared in this scope
   17 |   if ((data.at(i) >= (data.at(i+1) + 2))
      |                ^
a.cc:19:1: error: expected primary-expression before '}' token
   19 | }
      | ^
a.cc:18:17: error: expected ')' before '}' token
   18 |      ans = true;
      |                 ^
      |                 )
   19 | }
      | ~                
a.cc:17:6: note: to match this '('
   17 |   if ((data.at(i) >= (data.at(i+1) + 2))
      |      ^
a.cc:19:1: error: expected primary-expression before '}' token
   19 | }
      | ^
a.cc: At global scope:
a.cc:20:3: error: expected unqualified-id before 'if'
   20 |   if (ans) {
      |   ^~
a.cc:23:3: error: expected unqualified-id before 'else'
   23 |   else {
      |   ^~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> data(N);
  for (int i = 1; i < N; i++) {
    cin >> data.at(i);
  }
  bool ans = false;
  
  for (int i = 1; i < (N-2); i++) {
  if ((data.at(i) >= (data.at(i+1) + 1) && (data.at(i+1) >= (data.at(i+2) + 1)) 
     ans = true; 
  if ((data.at(i) >= (data.at(i+1) + 2)) {
     ans = true;
  }
      }
  if (ans) {
    cout << "No" << endl;
  }
  else {
    cout << "Yes" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:80: error: expected ')' before 'ans'
   14 |   if ((data.at(i) >= (data.at(i+1) + 1) && (data.at(i+1) >= (data.at(i+2) + 1))
      |       ~                                                                        ^
      |                                                                                )
   15 |      ans = true;
      |      ~~~                                                                        
a.cc:15:16: error: expected ')' before ';' token
   15 |      ans = true;
      |                ^
      |                )
a.cc:14:6: note: to match this '('
   14 |   if ((data.at(i) >= (data.at(i+1) + 1) && (data.at(i+1) >= (data.at(i+2) + 1))
      |      ^
a.cc:16:41: error: expected ')' before '{' token
   16 |   if ((data.at(i) >= (data.at(i+1) + 2)) {
      |      ~                                  ^~
      |                                         )
a.cc:19:7: error: expected primary-expression before '}' token
   19 |       }
      |       ^
Language: Java

import  java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int heights[] = new int[n];
    for(int i = 0; i < n; i++) heights[i] = scan.nextInt();
    
    int prev = -1;
    boolean judge = true;
    for(int height : heights) {
      if(prev == -1) {
        prev = height;
        continue;
      }
      
      if(prev < height - 1) {
        judge = false;
        continue;
      }
      
      if(prev > height ) {
        judge = false;
        continue;
      }
    }
    if(judge) {
      System.out.println('Yes');
    } else {
      System.out.println('No');
    }
  }
}

Compiler output:
Main.java:29: error: unclosed character literal
      System.out.println('Yes');
                         ^
Main.java:29: error: unclosed character literal
      System.out.println('Yes');
                             ^
Main.java:29: error: not a statement
      System.out.println('Yes');
                           ^
Main.java:31: error: unclosed character literal
      System.out.println('No');
                         ^
Main.java:31: error: unclosed character literal
      System.out.println('No');
                            ^
Main.java:31: error: not a statement
      System.out.println('No');
                           ^
6 errors
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> data(N);
  for (int i = 1; i < N; i++) {
    cin >> data.at(i);
  }
  bool ans = false;
  
  for (int i = 1; i < (N-2); i++) {
  if ((data.at(i) >= (data.at(i+1) + 1) && (data.at(i+1) >= (data.at(i+2) + 1)) 
     ans = true;
  }  
  if ((data.at(i) >= (data.at(i+1) + 2)) {
     ans = true;
  }  
}
  if (ans) {
    cout << "No" << endl;
  }
  else {
    cout << "Yes" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:80: error: expected ')' before 'ans'
   14 |   if ((data.at(i) >= (data.at(i+1) + 1) && (data.at(i+1) >= (data.at(i+2) + 1))
      |       ~                                                                        ^
      |                                                                                )
   15 |      ans = true;
      |      ~~~                                                                        
a.cc:15:16: error: expected ')' before ';' token
   15 |      ans = true;
      |                ^
      |                )
a.cc:14:6: note: to match this '('
   14 |   if ((data.at(i) >= (data.at(i+1) + 1) && (data.at(i+1) >= (data.at(i+2) + 1))
      |      ^
a.cc:17:16: error: 'i' was not declared in this scope
   17 |   if ((data.at(i) >= (data.at(i+1) + 2)) {
      |                ^
a.cc:17:41: error: expected ')' before '{' token
   17 |   if ((data.at(i) >= (data.at(i+1) + 2)) {
      |      ~                                  ^~
      |                                         )
a.cc:20:1: error: expected primary-expression before '}' token
   20 | }
      | ^
a.cc: At global scope:
a.cc:21:3: error: expected unqualified-id before 'if'
   21 |   if (ans) {
      |   ^~
a.cc:24:3: error: expected unqualified-id before 'else'
   24 |   else {
      |   ^~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

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

int main() {
  
  int n;
  cin >> n;
  
  for (int i = 0; i < n; i++) {
    cin >> ;
  }
  
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      cout << "i: " << i << ", j:" << j << endl;
    }
  }
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: expected primary-expression before ';' token
   10 |     cin >> ;
      |            ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:23: error: expected ';' before 'if'
   21 |         h.at(i+1) += 1
      |                       ^
      |                       ;
......
   24 |     if (r == "No")
      |     ~~
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;
  while(i<(N-1)){
    if(H.at(i+1)<=(H.at(i)-1)){
        b=b+H.at(i)-H.at(i+1)
      	if(b>=2){
         s="No";
         break;
        }
      }
    i++;
  }
  cout << s << endl;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:17:30: error: expected ';' before 'if'
   17 |         b=b+H.at(i)-H.at(i+1)
      |                              ^
      |                              ;
   18 |         if(b>=2){
      |         ~~
Language: C++

#include<iostream>
#include<vector>
#include<cmath>
#include <numeric>
#include<climits>
#include<cfloat>
#include<string>
#include<algorithm>
#include<map>
#include<utility>
#include<cstdio>

using namespace std;

typedef pair<int,bool> Pair;

int main(){

	int N;
	int INPUT;
	long long H[100001];
	bool res = true;
	
	cin >> N;
	
	H[0] = -1;
	
	for(int i = 1;i <= N;++i){
		
		cin >> INPUT;
		H[i] = INPUT;
		
		if(H[i-1]>H[i]) --H[i-1]; 
		else(H[i-1]>h[i]) --H[i-1];
	}

	for(int i = 1;i < N;++i){
		
		if(H[i+1]<H[i]) res = false; 
		
	}
	

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

}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:29: error: 'h' was not declared in this scope
   34 |                 else(H[i-1]>h[i]) --H[i-1];
      |                             ^
Language: C++

#include <iostream>
#include <stdlib.h>
using namespace std;

int main(void) {
    int n, min = 0, max = 0, minpos, maxpos;
    int h[100000];
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> h[i];
        if (i == 0) {
            min = h[i]; minpos = i;
            max = h[i]; maxpos = i;
        } else {
            if (min >= h[i]) {
                min = h[i];
                minpos = i;
            }
            if (max <= h[i]) {
                max = h[i];
                maxpos = i;
                min = INT_MAX;
                minpos = i;
                continue;
            }
            if ((maxpos < minpos) && (max - min >= 2)) {
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
    return 0;
#if 0        
        if (i != 0) {
            if (h[i-1]-h[i] >= 2) {
                cout << "No" << endl;
                return 0;
            }
        }
        if (i >= 2) {
            //            if (h[i-2] > h[i-1] && h[i-1] > h[i]) {
            if (h[i-2] > h[i]) {
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
    return 0;
#endif
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:23: error: 'INT_MAX' was not declared in this scope
   22 |                 min = INT_MAX;
      |                       ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <stdlib.h>
  +++ |+#include <climits>
    3 | using namespace std;
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);
  
  int max_so_far = 0
  for (int i=0; i<N; i++) {
    if (H.at(i) < max_so_far)
      continue;
    if (H.at(i) > max_so_far)
      max_so_far = H.at(i)
    for (int j=i+1; j<N; j++) {
      if ((H.at(i)-H.at(j))>1) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  
  cout << "Yes" << endl;
    
}



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

#include<stdio.h>
#include<math.h>
int main()
{
  int A,b,e,d,c=0,f=0;
  int v[100000];
  scanf("%d",&A);
  for(int i=1;i<=A;i++){
      scanf("%d",&v[i]);
  }
  for(int i=1;i<(A-1);i++){
      d=0;
      e=0;
      d=(v[i]-v[i+1]);
      e=(v[i+1]-v[i+2]);
      if(d>=1&&e>=1){
          break;
      }
      f+=1;
  }
  for(int i=1;i<A;i++){
      b=0;
   b=v[i]-v[i+1];
   if(b>=2){
       break
   }
   c+=1;
    }
    if(c==(A-1)&&f==(A-2)||A==1){
        printf("Yes");
    }else{
        printf("No");
    }
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:13: error: expected ';' before '}' token
   25 |        break
      |             ^
      |             ;
   26 |    }
      |    ~
Language: C++

#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>

using namespace std;  //このネームスペースを使う

int main(){
  int N ;
  int j;
  int flag;
  int flag_ze
  cin >> N ;

  int H[N];
  int i,tmp;
  for(i=0;i<N;i++){
    cin >> H[i];
  }
  
  j=0;
  tmp=0;
  flag=0;
  flag_ze=0;
  for(i=0;i<N-1;i++){
  	tmp = H[i+1]-H[i];
    if(tmp < (-1) || ((tmp==(-1) or flag_ze ==1)&&flag==1)){
      j=-1;
      break;
    }
    else{
      if(tmp==(-1)){
        flag=1;
      }
      else if(tmp==0){
        flag_ze += 1;
      }
      else{
        flag=0;
        flag_ze=0;
      }
    }
  }
  
  if(j==(-1)){
  	   	cout << "No" << endl;
  }
  else{
  	   	cout << "Yes" << endl;  	
  }

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: expected initializer before 'cin'
   13 |   cin >> N ;
      |   ^~~
a.cc:24:3: error: 'flag_ze' was not declared in this scope; did you mean 'flag'?
   24 |   flag_ze=0;
      |   ^~~~~~~
      |   flag
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() 
{
  int N;
  cin >> N;
  vector<int> A(N);
  for(int i=0;i<N;i++){
    cin>>A.at(i);
  }
  
  bool b=true;
  for(int i=0;i<N-1;i++){
    if((A.at(i)-1)>A.at(i+1)){
      b=false;
    }
  }
  
  for(int i=0;i<N-1;i++){
    if(A.at(i)>A.at(i+1)){
      A.at(i) = A.at(i) +1
    }
  }
  
  for(int i=0;i<N-1;i++){
    if((A.at(i)-1)>A.at(i+1)){
      b=false;
    }
  }
  

  
  if(b==true){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  
}
             

Compiler output:
a.cc: In function 'int main()':
a.cc:22:27: error: expected ';' before '}' token
   22 |       A.at(i) = A.at(i) +1
      |                           ^
      |                           ;
   23 |     }
      |     ~
Language: C++

    
    for(i = 0; i < n; i++){
        if(a[i] > a[i + 1]){
            flag = 1;
            break;
        }
    }

    if(flag == 0 || n == 1){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}


Compiler output:
a.cc:2:5: error: expected unqualified-id before 'for'
    2 |     for(i = 0; i < n; i++){
      |     ^~~
a.cc:2:16: error: 'i' does not name a type
    2 |     for(i = 0; i < n; i++){
      |                ^
a.cc:2:23: error: 'i' does not name a type
    2 |     for(i = 0; i < n; i++){
      |                       ^
a.cc:9:5: error: expected unqualified-id before 'if'
    9 |     if(flag == 0 || n == 1){
      |     ^~
a.cc:11:6: error: expected unqualified-id before 'else'
   11 |     }else{
      |      ^~~~
a.cc:14:1: error: expected declaration before '}' token
   14 | }
      | ^
Language: C


#include <stdio.h>
 
int main(void) {
int N;
int count=0;
int decount=0;
int i;
scanf("%d", &N);
int H[N];
 
for(i=0;i<N;i++){
	scanf("%lld",&H[i]);
}
for(i=0;i<N-1;i++){
 
		if(H[i]-H[i+1]>1){
			count=count+2;
	}else if(H[i]-H[i+1]==1){
			
		if(i>1){
			if(H[i]-1 == H[i-1]){
				decount=decount;
					}
				}else{
			decount=decount+2;
			}
}
		}else if(H[i]-H[i+1]<1){
			count=count;
		}
}
if(count<2 && decount<2){
	printf("Yes");
}else{
	printf("No");
}
 
return 0;
 
}

Compiler output:
main.c: In function 'main':
main.c:29:18: error: 'else' without a previous 'if'
   29 |                 }else if(H[i]-H[i+1]<1){
      |                  ^~~~
main.c: At top level:
main.c:33:1: error: expected identifier or '(' before 'if'
   33 | if(count<2 && decount<2){
      | ^~
main.c:35:2: error: expected identifier or '(' before 'else'
   35 | }else{
      |  ^~~~
main.c:39:1: error: expected identifier or '(' before 'return'
   39 | return 0;
      | ^~~~~~
main.c:41:1: error: expected identifier or '(' before '}' token
   41 | }
      | ^
Language: C++

#include <stdio.h>

#define N 100001

int main(void)
{
	int i, n, judge = 1;
	long long int h[N];

	scanf("%d", &n);

	for (i = 0; i < n; i++)
		scanf("%lld", &h[i]);

	for (i = 0; i < n; i++)
	{
		if (h[i] > h[i - 1])
			h[i - 1]--;
		else if (h[i] < h[i - 1])
		{
			judge = 0;
			break;
		}
	}
	printf(judge ? "Yes\n", "N0\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:39: error: expected ':' before ')' token
   25 |         printf(judge ? "Yes\n", "N0\n");
      |                                       ^
      |                                       :
a.cc:25:39: error: expected primary-expression before ')' token
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long N,H[i];
	cin>>N;
	for(int i=1;i<=N;i++)
	{
		H[i];
		cin>>H[i];
	}

  
if(H[N-1]>H[N-2])
cout<<"Yes";
else cout<<"No";    
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:23: error: 'i' was not declared in this scope
    5 |         long long N,H[i];
      |                       ^
a.cc:9:17: error: 'H' was not declared in this scope
    9 |                 H[i];
      |                 ^
a.cc:14:4: error: 'H' was not declared in this scope
   14 | if(H[N-1]>H[N-2])
      |    ^
Language: C++


#include <cmath>
#include <iostream>
#include <string>
#include <utility>

using namespace std;

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

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

  long long pre(0), prepre(0);
  long long last_sousa(0);
  long long now;
  bool pre_sousazumi(false), prepre_sousazumi(false);
  bool res(true);
  FOR(i,n) {
    if (!res) {
      cin >> now;
      continue;
    }

    if (i == 0) {
      cin >> prepre;
      continue;
    } else if (i == 1) {
      cin >> pre;
      if (prepre - pre == 1) {
        if (prepre == 1) {
          res = false;
          continue;
        }
        --prepre;
        last_sousa = prepre;
        prepre_sousazumi = true;
      } else if (prepre - pre > 1) {
        res = false;
        continue;
      }
    } else if (i > 1) {
      cin >> now;
      if (now >= pre) {
        prepre = pre;
        prepre_sousazumi = pre_sousazumi;
        pre = now;
        pre_sousazumi = false;
        continue;
      } else if (now < pre) {
        if (pre - now > 1) {
          res = false;
          continue;
        } else if (pre - now == 1) {
          if (pre_sousazumi) {
            res = false;
            continue;
          } else {
            if (pre > prepre) {
              if (pre == 1) {
                res = false;
                continue;
              }
              --pre;
              last_sousa = pre;
              pre_sousazumi = true;
              prepre = pre;
              prepre_sousazumi = pre_sousazumi;
              pre = now;
              pre_sousazumi = false;
              continue;
            } else if (pre == prepre) {
                if (pre == 1) {
                  res = false;
                  continue;
                }
                if (last_sousa == pre) {
                  res = false;
                  continue;
                }
                --pre;
                last_sousa; = pre;
                pre_sousazumi = true;
                prepre = pre;
                prepre_sousazumi = pre_sousazumi;
                pre = now;
                pre_sousazumi = false;
                continue;
            }
          }
        }
      }
    }
  }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:85:29: error: expected primary-expression before '=' token
   85 |                 last_sousa; = pre;
      |                             ^
Language: C++

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

int main() {
  int N;
  cin>>N;
  vector<int> vec(N);
  int ans=0;
  for(int i=0;i<N;i++){
    cin>>vec.at(i);
  }
  for(int i=0;i<N-1;i++){
    if(vec.at(i)>vec.at(i+1)+1){
      ans=1;
    }
    else if(vec.at(i)>vec.at(i+1)){
      vec.at(i)-=;
    }
  }
      
  
  if(ans==0){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:18: error: expected primary-expression before ';' token
   17 |       vec.at(i)-=;
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	ll N,i,j,H[i];
	cin>>N;
	for(i=1;i<=N;i++)
	{
		H[i];
		cin>>H[i];
	}

  
if(H[N-1]>H[N-2])
cout<<"Yes";
else cout<<"No";    
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'll' was not declared in this scope
    5 |         ll N,i,j,H[i];
      |         ^~
a.cc:6:14: error: 'N' was not declared in this scope
    6 |         cin>>N;
      |              ^
a.cc:7:13: error: 'i' was not declared in this scope
    7 |         for(i=1;i<=N;i++)
      |             ^
a.cc:9:17: error: 'H' was not declared in this scope
    9 |                 H[i];
      |                 ^
a.cc:14:4: error: 'H' was not declared in this scope
   14 | if(H[N-1]>H[N-2])
      |    ^
Language: C++

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

int main() {
  int N;
  cin>>N;
  vector<int> vec(N);
  int ans=0;
  for(int i=0;i<N;i++){
    cin>>vec.at(i);
  }
  for(int i=0;i<N;i++){
    if(vec.at(i)>vec.at(i+1)+1){
      ans=1;
    }
    else if(vec.at(i)>vec.at(i+1)){
      vec.at(i)-=;
    }
  }
      
  
  if(ans==0){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:18: error: expected primary-expression before ';' token
   17 |       vec.at(i)-=;
      |                  ^
Language: C++

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

using namespace std;

int main(void)
{
  int n,buff;
  cin >> n;

  vector<long> VH;

  for(int i = 0;i < n;i++){
    cin >> buff;
    VH.push_back(buff);
  }

  bool flag = true;

  for(int i = 0;i < n - 2;i++){
    if(VH[i] > VH[i + 1] + 1) flag = false;
  }

  if(flag && VH[n - 1] >= VH[n - 2]){
    cout << "Yes" << endl;
  }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:30:25: error: expected ';' before '}' token
   30 |     cout << "No" << endl
      |                         ^
      |                         ;
   31 |   }
      |   ~
Language: Java

public class Main {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        String N = scanner.nextLine();
        int n = Integer.parseInt(N);
        String line = scanner.nextLine();
        String[] strs = line.split(" ");
        int[] values = new int[strs.length];

        for (int i = 0; i < strs.length; i++) {
            values[i] = Integer.parseInt(strs[i]);
        }

        boolean[] changed = new boolean[n];
        boolean can = true;
        while (true) {
            boolean hasChanged = false;
            int i;
            for (i = 1; i < values.length; i++) {
                if (values[i] < values[i - 1]) {
                    if (!changed[i - 1]) {
                        values[i - 1] = values[i - 1] - 1;
                        changed[i - 1] = true;
                        hasChanged = true;
                    } else {
                        can = false;
                        break;
                    }
                }
            }
            if (hasChanged) {
                continue;
            }
            if (i >= values.length || !can) {
                break;
            }
        }
        if(can) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

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

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

int main() {
  int N;
  cin>>N;
  vector<int> vec(N);
  int ans=0;
  for(int i=0;i<N;i++){
    cin>>vec.at(i);
  }
  for(int i=0;i<N;i++){
    if(vec.at(i)>vec.at(i+1)+1){
      ans=1;
    }
    else if(vec.at(i)>vec.at(i+1)){
      vec.at(i)-=
    }
  }
      
  
  if(ans==0){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: expected primary-expression before '}' token
   18 |     }
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a[100009],num=0,;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
        scanf("%d",&a[i]);
    for(int i=1; i<n; i++)
    {
        if(a[i-1]-a[i]>1)
        {
            printf("No");
            return 0;
        }
    }
    for(int i=1; i<n; i++)
        if(a[i-1]>a[i])
        {
            printf("No");
            return 0;
        }
    printf("Yes");
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:27: error: expected unqualified-id before ';' token
    5 |     int n,a[100009],num=0,;
      |                           ^
Language: C++

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

#define rep for(int i = 0;i<n;i++)
const int MOD = 1000000007;

int main(){
     int n;cin >> n;
     int a[n];rep{
             cin >> a[i];
     }
     string frag = "Yes";
     for(int i = 2;i<n;i++){
             if( (a[i-2] - a[i-1]) == 1 and (a[i-1] - a[i] == 1 ) frag = "No";
     }
     for(int i = 1;i<n;i++){
             if(a[i-1]-a[i] > 1) frag = "No";
     }
     cout << frag << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:66: error: expected ';' before 'frag'
   14 |              if( (a[i-2] - a[i-1]) == 1 and (a[i-1] - a[i] == 1 ) frag = "No";
      |                                                                  ^~~~~
      |                                                                  ;
a.cc:15:6: error: expected primary-expression before '}' token
   15 |      }
      |      ^
a.cc:14:79: error: expected ')' before '}' token
   14 |              if( (a[i-2] - a[i-1]) == 1 and (a[i-1] - a[i] == 1 ) frag = "No";
      |                ~                                                              ^
      |                                                                               )
   15 |      }
      |      ~                                                                         
a.cc:15:6: error: expected primary-expression before '}' token
   15 |      }
      |      ^
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:11:27: error: lvalue required as left operand of assignment
   11 |             if(H[i-1]-H[i]=1)
      |                           ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> data(N);
  for (int i = 0; i < N; i++) {
    cin >> data.at(i);
  }

  int counter = 0;

  for (int i = 0; i < N; i++) {
    if (data.at(i) > data.at(i+1)) {
      counter++;
    }
   }
  }
    if(counter >= 2){
    cout << "YES" << endl;
    }
    else{
    cout << "NO" << endl;
    }
}


Compiler output:
a.cc:20:5: error: expected unqualified-id before 'if'
   20 |     if(counter >= 2){
      |     ^~
a.cc:23:5: error: expected unqualified-id before 'else'
   23 |     else{
      |     ^~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> data(N);
  for (int i = 0; i < N; i++) {
    cin >> data.at(i);
  }

  int counter = 0;

  for (int i = 0; i < N; i++) {
    if (data.at(i) > data.at(i+1)) {
      counter++;
    }
   }
  }
	if(counter >= 2){
    cout << "YES" << endl;
    }
    else{
    cout << "NO" << endl;
    }
}


Compiler output:
a.cc:20:9: error: expected unqualified-id before 'if'
   20 |         if(counter >= 2){
      |         ^~
a.cc:23:5: error: expected unqualified-id before 'else'
   23 |     else{
      |     ^~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(void)
{
  int n;
  Bool m = True;
  cin >> n;
  vector<int> a(n);
  for(int i = 0;i < n; i++)
  {
    cin >> a[i];
  }
  
  for(int i = 0; i < n;i++)
  {
    if(a[i] > a[i + 1])
      a[i]--;
  }
  
  for(int i = 0; i < n;i++)
  {
    if(a[i] >= a[i + 1])
    {
      m = False;
      break;
    } 
  }
  
  if(m)
    cout << "Yes";
  else
    cout << "No";
  
  return 0;
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'Bool' was not declared in this scope; did you mean 'bool'?
    7 |   Bool m = True;
      |   ^~~~
      |   bool
a.cc:25:7: error: 'm' was not declared in this scope
   25 |       m = False;
      |       ^
a.cc:25:11: error: 'False' was not declared in this scope
   25 |       m = False;
      |           ^~~~~
a.cc:30:6: error: 'm' was not declared in this scope
   30 |   if(m)
      |      ^
Language: C++

#include<iostream>
#include<algorithm>
#include <cmath>
using namespace std;
 
int main(){
    int N,a=0,b,c,d,e,f,i;
   // sort(M,M+N);
    cin >> N;
     int M[N+10];

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

}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:28:15: error: expected primary-expression before ')' token
   28 |    if(i==N-2&&) cout <<"Yes";
      |               ^
Language: C++

        if(a[i] > a[i + 1]){
            flag = 1;
            break;
        }
    }

    if(flag == 0 || n == 1){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}


Compiler output:
a.cc:1:9: error: expected unqualified-id before 'if'
    1 |         if(a[i] > a[i + 1]){
      |         ^~
a.cc:5:5: error: expected declaration before '}' token
    5 |     }
      |     ^
a.cc:7:5: error: expected unqualified-id before 'if'
    7 |     if(flag == 0 || n == 1){
      |     ^~
a.cc:9:6: error: expected unqualified-id before 'else'
    9 |     }else{
      |      ^~~~
a.cc:12:1: error: expected declaration before '}' token
   12 | }
      | ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> data(N);
  for (int i = 0; i < N; i++) {
    cin >> data.at(i);
  }

  int counter = 0;

  for (int i = 0; i < N; i++) {
    if (data.at(i) > data.at(i+1)) {
      counter++;
    }
   }
  }
	if(counter >= 2){
    cout << "YES" << endl;
	}
	else{
    cout << "NO" << endl;
	}
}


Compiler output:
a.cc:20:9: error: expected unqualified-id before 'if'
   20 |         if(counter >= 2){
      |         ^~
a.cc:23:9: error: expected unqualified-id before 'else'
   23 |         else{
      |         ^~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C

#include<stdio.h>
#include<stdlib.h>
int main(){
  int n;
  int max=0;
  int h[10000]=0;
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%d",&h[i]);
    if(h[i]>max){
      max=h[i];
    }
    else if(max-h[i]>1){
      printf("No");
      exit(0);
    }
  }
  printf("Yes");
}

Compiler output:
main.c: In function 'main':
main.c:6:16: error: invalid initializer
    6 |   int h[10000]=0;
      |                ^
Language: C++

#include <bits/stdc++.h>
#include <chrono>
#define watch(x) cout << (#x) << " is " << (x) << endl
#define eps 1e-9
#define f first
#define s second

typedef long long ll;

using namespace std;

int main()

{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    int n;

    cin >> n;

    int arr[n];

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

    for (int i = 0; i < n; i++) {

        if (arr[i] >= maxi) ind1 = i, maxi = arr[i];
        else if (maxi-arr[i] > 1) {

        	cout << "No";
        	return 0;
        }
    }

    cout << "Yes";

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:23: error: 'maxi' was not declared in this scope
   27 |         if (arr[i] >= maxi) ind1 = i, maxi = arr[i];
      |                       ^~~~
a.cc:27:29: error: 'ind1' was not declared in this scope
   27 |         if (arr[i] >= maxi) ind1 = i, maxi = arr[i];
      |                             ^~~~
Language: Java

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

        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextLong();
        }

        System.out.println(buildStairs(arr));


    }

    public static boolean buildStairs(long[] arr) {
        int count = 0;
        for (int i = 1; i < arr.length; i++) {
            long diff = arr[i] - arr[i-1];
            if (diff < -1) return false;
            else if (diff == -1 && count == -1) return false;
            else if (diff == -1) count--;
            else count = 0;
        }

        return true;
    }
}

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

#include<stdio.h>

int main(){
    int n,i,flg=0,j,k=0;

    scanf("%d",&n);
    int a[n];

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

Compiler output:
main.c: In function 'main':
main.c:19:43: error: lvalue required as left operand of assignment
   19 |                 while(j<n-1 && a[j]-a[j+1]=0 ){
      |                                           ^
main.c:35:1: error: expected declaration or statement at end of input
   35 | }
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:54: error: expected ')' before '{' token
   16 |     }else if(A.at(i)>A.at(i+1) && A.at(i+1)>A.at(i+2){
      |             ~                                        ^
      |                                                      )
a.cc:19:3: error: expected primary-expression before '}' token
   19 |   }
      |   ^