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

#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<string>
#include<queue>

#define lli long long
#define all(i) i.begin(),i.end()
#define rall(i) i.rbegin(),i.rend()
#define rep0(i,j) for(int i=0;i<j;i++)
#define rep1(i,j) for(int i=1;i<=j;i++)
#define rep0d(i,j) for(int i=j-1;i>=0;i--)
#define MAX 1000000007
#define MAX_V 2*100000+10

using namespace std;



bool cmpf(const pair<lli, lli> left, const pair<lli, lli> right) {
	return left.first < right.first;
}
bool cmps(const pair<lli, lli> left, const pair<lli, lli> right) {
	return left.second < right.second;
}
using namespace std;
lli k, n, m, e;


int main() {
	lli x, y, z=0;
	cin >> x;
	rep1(i, x)if ((y = (int)log10(i)) % 2==0)z++;

	cout << z;

}




Compiler output:
a.cc: In function 'int main()':
a.cc:34:33: error: 'log10' was not declared in this scope
   34 |         rep1(i, x)if ((y = (int)log10(i)) % 2==0)z++;
      |                                 ^~~~~
Language: C

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i < (int)(n); i++)
#define REP(i, m, n) for(int i = (m); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define MOD 1000000007
#define INF (1e9)
#define PI (acos(-1))
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl

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

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

template<class T> inline auto __lcm(T& a, T& b) 
{ return a * b / __gcd(a, b); }


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

    int cnt = 0;
    rep(i, N) {
        if (to_string(i+1).size() % 2 != 0) {
            ++cnt;
        }
    }

    print(cnt);

    return 0;
}



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 "SaveFuncs.cpp"

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

using namespace std;
using ll = long long;

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

/*****/

int Main()
{
	int N;
	cin >> N;

	int ret = 0;

	if (N < 10)
	{
		ret += N;
	}
	else
	{
		ret += 9;
		if (N < 100)
		{
		}
		else
		{
			if (N < 1000)
			{
				ret += N - 100 + 1;
			}
			else
			{
				ret += 900;
				if (N < 10000)
				{
				}
				else
				{
					if (N < 100000)
					{
						ret += N - 10000 + 1;
					}
					else
					{
						ret += 90000;
					}
				}
			}
		}
	}

	cout << ret << endl;


	return 0;
}

/*****/

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

	Main();

	return 0;
}


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

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

int main() {
  int N;
  cin >> N;
  
  if (N == 100000)
    cout << 90909 << endl;
  
  else if (N > 9999)
    cout << N - 9090 << endl;
  
  else if (N > 999)
    cout << 909 <<< endl;
  
  else if (N > 99)
    cout << N - 90 << endl;
  
  else if (N > 9)
    cout << 9 << endl;
  
  else
    cout << N << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: expected primary-expression before '<' token
   15 |     cout << 909 <<< endl;
      |                   ^
Language: Java

import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int count = 0;
    for(int i = 1; i <= n; i++) {
      if (String.valueOf(i).length() % 2 == 1) count++;
    }
    System.out.println(count);
  }


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

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

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

    int count = 0;
    for (int i = N;  i >= 1  ; --i) {
        if (std::to_string(i).length % 2 == 1){
            count++;
        }
    }

    cout << count << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:31: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   11 |         if (std::to_string(i).length % 2 == 1){
      |             ~~~~~~~~~~~~~~~~~~^~~~~~
      |                                     ()
Language: C++

#include <iostream>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <cstring>

using namespace std;


int main(){
    int N;
    cin >> N;
    int digit = log10(N)+1;
    int answer = 0;

    for(int i=1;i<digit; i+=2){
        answer+=9*pow(10, i-1);
    }


    if(digit%2==1){
        answer += N - pow(10, digit-1)+1;
    }

    cout<< answer << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'log10' was not declared in this scope
   15 |     int digit = log10(N)+1;
      |                 ^~~~~
a.cc:19:19: error: 'pow' was not declared in this scope
   19 |         answer+=9*pow(10, i-1);
      |                   ^~~
a.cc:24:23: error: 'pow' was not declared in this scope
   24 |         answer += N - pow(10, digit-1)+1;
      |                       ^~~
Language: C++

#include<iomanip>
#define mins(a,b) a=min(a,b)
#define maxs(a,b) a=max(a,b)
template < typename T > std::string to_string( const T& n )
  {
    std::ostringstream stm ;
    stm << n ;
    return stm.str() ;
  }
using namespace std;

const long long INF=9000000000000000;
const long long mod=1000000007;
typedef long long ll;

int main(){
  int a,b,c;
  cin>>a;
  if(a<100){
    cout<<min(9,a)<<endl;
  }
  else if(a>=100 and a<10000){
    cout<<9+min(900,a-99)<<endl;
  }
  else if(a>=10000){
    cout<<909+min(90000,a-9999)<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: 'cin' was not declared in this scope
   18 |   cin>>a;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<iomanip>
  +++ |+#include <iostream>
    2 | #define mins(a,b) a=min(a,b)
a.cc:20:5: error: 'cout' was not declared in this scope
   20 |     cout<<min(9,a)<<endl;
      |     ^~~~
a.cc:20:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout<<9+min(900,a-99)<<endl;
      |     ^~~~
a.cc:23:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:5: error: 'cout' was not declared in this scope
   26 |     cout<<909+min(90000,a-9999)<<endl;
      |     ^~~~
a.cc:26:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<bits/stdc++.h>
#define int long long
#define x first
#define y second
#define pb push_back

#define speed ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;

signed main()
{
    #endif
    speed
    int n;cin>>n;
    string s=to_string(n);
    int tot=s.length();
    int pres=1;
    int ans=0;
    for(int i=1;i<tot;++i)
    {
        if(i%2)
        {
            ans+=(9*pres);
        }
        pres*=10;
    }
    if(tot%2){ans+=(n-pres+1);}
    cout<<ans<<"\n";
}

Compiler output:
a.cc:12:6: error: #endif without #if
   12 |     #endif
      |      ^~~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    REP(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    REP(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

int main()
{
	int N = inputValue();
	
	int val;
	if(N < 9){
	    val1 = N;
	}else if(10 <= N && N < 100){
		val1 = 9;
	}else if(100 <= N && N < 1000){
		val1 = N - 90;
	}else if(1000 <= N && N < 10000){
		val1 = 909;
	}else if(10000 <= N && N < 100000){
		val1 = N - 9090;
	}else{
		val1 = 90909;
	}
	
	cout << val1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:13: error: 'val1' was not declared in this scope; did you mean 'val'?
   36 |             val1 = N;
      |             ^~~~
      |             val
a.cc:38:17: error: 'val1' was not declared in this scope; did you mean 'val'?
   38 |                 val1 = 9;
      |                 ^~~~
      |                 val
a.cc:40:17: error: 'val1' was not declared in this scope; did you mean 'val'?
   40 |                 val1 = N - 90;
      |                 ^~~~
      |                 val
a.cc:42:17: error: 'val1' was not declared in this scope; did you mean 'val'?
   42 |                 val1 = 909;
      |                 ^~~~
      |                 val
a.cc:44:17: error: 'val1' was not declared in this scope; did you mean 'val'?
   44 |                 val1 = N - 9090;
      |                 ^~~~
      |                 val
a.cc:46:17: error: 'val1' was not declared in this scope; did you mean 'val'?
   46 |                 val1 = 90909;
      |                 ^~~~
      |                 val
a.cc:49:17: error: 'val1' was not declared in this scope; did you mean 'val'?
   49 |         cout << val1 << endl;
      |                 ^~~~
      |                 val
Language: C++

#include <bits/stdc++.h>
#define rep(i,n,m) for(int i=n;i<(int)(m);i++)
#define rrep(i,n,m) for(int i=((int)(n)-1);i>=m;i--)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
const int MOD=1000000007;
using namespace std;
int main(){
    int n;
    cin>>n;
    if(n<10) cout<<n<<endl; //1桁
    else if(n<100) cout<<9<<endl; //2桁
    else if(n<1000) cout<<9+n-99<<endl; //3桁
    else if(n<10000) cout<<909; //4桁 1-9,100-999
    else (n<100000) cout<<909+n-9999<<endl; //1-9,100-999,10000-n
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: expected ';' before 'cout'
   15 |     else (n<100000) cout<<909+n-9999<<endl; //1-9,100-999,10000-n
      |                    ^~~~~
      |                    ;
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<iomanip>
#include<math.h>
using namespace std;
int main(){
  long long int N;
  cin >>N;
  long long int a;
  if(N<10){
    a=N;
  }
  else if(N<100){
    a=9;
  }
  else if(N<1000){
    ans=9+N-100+1;
  }
  else if(N<10000){
    ans=909;
  }
  else if(N<100000){
    ans=9+900+N-10000+1;
  }
  else{
    ans=90909;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |     ans=9+N-100+1;
      |     ^~~
      |     abs
a.cc:28:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |     ans=909;
      |     ^~~
      |     abs
a.cc:31:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |     ans=9+900+N-10000+1;
      |     ^~~
      |     abs
a.cc:34:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   34 |     ans=90909;
      |     ^~~
      |     abs
a.cc:36:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   36 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include<iostream>
#include<algorithm>
#include<math.h>
using namespace std;

int main(){
	int n;
	cin>>n;
	int ans=0;
	if(ans<10){cout<<n<<endl;}
	else if(ans<100){cout<<9<<endl;}
	else if(ans<1000){cout<<(9+ans-99)<<endl;}
	else if(ans<10000){cout<<(10-1+1000-100)<<endl;}
	else if(ans<100000){cout<<(10-1+1000-100+ans-10000+1)<<endl;}}
	else{cout<<(10-1+1000-100+100000-10000)<<endl;}
}

Compiler output:
a.cc:15:9: error: expected unqualified-id before 'else'
   15 |         else{cout<<(10-1+1000-100+100000-10000)<<endl;}
      |         ^~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

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

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
#define rep(i,a,b) for(int (i)=int(a);(i)<int(b);(i)++)
#define rrep(i,a,b) for(int (i)=int(a);(i)>=int(b);(i)--)

#define put(a) cout << (a) << endl
#define puts(a) cout << (a) << " "

#define llint long long int

#define INF (long long)1e9+1
#define MOD (long long)1e9+7
#define INF64 (long long)1e18+1

#define F first
#define S second

#define Pii  pair<int,int>
#define Pll  pair<long long,long long>
#define Piii pair<int,pair<int,int>>
#define Plll pair<long long,pair<long long,long long>>

#define Vll(a,b,c)    vector<vector<long long>> (a)((b),vector<long long>((c))
#define Vlll(a,b,c,d) vector<vector<vector<long long>>> (a)((b),vector<vector<long long>>((c),vector<long long>((d)))

#define MAX_N 1000000

int main (void)
{
  llint N,M,L,A,B;
  llint K[MAX_N];
  llint ans;
  vector<char> C;
  bool bool_ans;

  cin >> N;
  rep(i,1,N+1) {
    if ((i<10)
      || ((i>=100)&&(i<1000))
      || (i>=10000)&&(i<100000) {
      ans++;
    }
  }
  put(ans);

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:32: error: expected ')' before '{' token
   50 |       || (i>=10000)&&(i<100000) {
      |                                ^~
      |                                )
a.cc:48:8: note: to match this '('
   48 |     if ((i<10)
      |        ^
a.cc:53:3: error: expected primary-expression before '}' token
   53 |   }
      |   ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#define ll long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,0,n)
#define SORT(V) sort((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
using namespace std;

int main(){
  int N,ans=0;
  cin>>N;
  
  if(N<=9) ans=N;
  else if(N<=10 && N<=99) ans=9;
  else if(N<=100 && N<=999) ans=N-90;
  else if(N<=1000 && N<=9999) ans=909;
  else if ans=N-9090;
  
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:11: error: expected '(' before 'ans'
   26 |   else if ans=N-9090;
      |           ^~~
      |           (
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define pback push_back
#define mpair make_pair
#define MODN 1000000007

using namespace std;

int digit(int n){
    int k = 1;
    while(n >= 10){
        n = n / 10;
        k++
    }

    return k;
}

int main(){

    int n;
    cin >> n;

    int ans = 0;

    for(int i = n; i > 0; i--){
        if(digit(i) % 2 == 1) ans++;
    }

    cout << ans << endl;

    return 0;

}

Compiler output:
a.cc: In function 'int digit(int)':
a.cc:14:12: error: expected ';' before '}' token
   14 |         k++
      |            ^
      |            ;
   15 |     }
      |     ~
Language: C++

N = int(input())
ans = 0
for i in range(N, -1, -1):
    if len(str(i)) % 2 == 1:
        ans += 1

print(ans - 1)


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

# include <iostream>


using namespace std;


int main() {
    int n; cin >> n;
    int ans = 0;

    for (int i=1; i<=n; ++i) {
        int d = log10(i)+1;
        if (d % 2 == 1) ans++;
    }

    cout << ans << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'log10' was not declared in this scope
   12 |         int d = log10(i)+1;
      |                 ^~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

int main(){
  int n;
  cin >> n;
  if(n < 10) cout << n << endl;
  else if(n < 100) cout << 9 << endl;
  else if(n < 1000) cout << 9 + n - 99 << endl;
  else if(N < 10000) cout << 909 << endl;
  else if(N < 100000) cout << 909 + n - 9999 << endl;
  else if(N < 1000000) cout << 90909 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: 'N' was not declared in this scope
   13 |   else if(N < 10000) cout << 909 << endl;
      |           ^
Language: C++

n = int(input())
ans = 0
for x in range(1, n + 1):
  cnt = 0
  while x > 0:
    cnt += 1
    x /= 10
  if cnt % 2 == 1:
    ans += 1
print(ans)

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;
#pragma GCC optimize("unroll-loops") 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#define int long long
#define fr(i,a,b) for(int i = a ; i <= b ; ++i)
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define pb push_back
#define fst first
#define snd second
using namespace __gnu_pbds;
using ordered_set =
 tree<int, null_type,less<int>,
 rb_tree_tag,tree_order_statistics_node_update>;
//find_by_order(k):returns iterator to kth element starting from 0
//order_of_key(k):returns count of elements strictly smaller than k
typedef long long ll;typedef pair<int, int> pii;
typedef vector<int> vi;typedef long double ld;
template<class T>
using min_heap = priority_queue<T,vector<T>,greater<T>>; 
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template<typename T> T lcm(T a, T b){return(a*(b/gcd(a,b)));}
template<class T> void re(T& x) { cin >> x; }
template<typename T> 
void remdup(vector<T>& v) {
	sort(all(v)); v.erase(unique(all(v)), v.end());
}
template<typename T> void re(vector<T> &v) {trav(i,v) cin >> i;}
template<class H, class... T> void re(H& h, T&... t) { re(h); re(t...); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
#ifdef np
#include "/home/o_o/MyCodes/pr.h"
#else
#define trace(...)
#endif

#define MOD 1000000007  

void solve(){
	int n; 
	re(n);
	vi v(n);
	re(v);
	for(int i = n-1 ; i>=0 ;  --i){
		if(a[i] > a[i+1]) a[i]--;
		if(a[i] > a[i+1]){
			cout << "No\n";
			return;
		}
	}
	cout << "Yes\n";
}

signed main() {
	unsyncIO();
	int tt =1 ;
	// cin >> tt;
	rep(i,0,tt) solve();













#ifdef np
	cout <<endl<<endl<< "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:50:20: error: 'a' was not declared in this scope
   50 |                 if(a[i] > a[i+1]) a[i]--;
      |                    ^
a.cc:51:20: error: 'a' was not declared in this scope
   51 |                 if(a[i] > a[i+1]){
      |                    ^
Language: C++

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

void solve(){

	int n ;
	cin>>n ;

	vector<int> a(n) ;


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

	if(n===1){
		cout<<"Yes" ;
		return ;
	}

	for(int i=n-2;i>=0;i--){
		if(a[i]>a[i+1]){
			a[i]-- ;
		}

	}

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

	cout<<"Yes" ;

}


int main(){

	int y ;

	y=1 ;
	//cin>>y ;

	while(y--)
	{	
		solve() ;
	}

}

Compiler output:
a.cc: In function 'void solve()':
a.cc:19:15: error: expected primary-expression before '=' token
   19 |         if(n===1){
      |               ^
Language: C++

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

void solve(){

	int n ;
	cin>>n ;

	vector<int> a(n) ;

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

	for(int i=n-2;i>=0;i--){
		if(a[i]>a[i+1]){
			a[i]-- ;
		}

	}

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

	cout<<"Yes" ;

}


int main(){
	
	int y ;

	y=1 ;
	//cin>>y ;

	while(y--)
	{	
		solve() ;
	}

}v

Compiler output:
a.cc:50:2: error: 'v' does not name a type
   50 | }v
      |  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
  ll N;
  cin>>N;
  vector<ll> H(N);
  for(ll i=0;i<N;i++) {
cin>>H[i];
  }
  
  for(ll i=0;i<N-1;i++) {
if(vec[i]-1>vec[i+1]) {
cout<<"No"<<endl;
return 0;
}
  }
  
  cout<<"Yes"<<endl;
}

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:7:12: 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];
  }
  bool flag = true;
  for(int i = n - 1; i > 0; i--){
    if(!(h[i] >= h[i - 1] || h[i - 1] - s[i] == 1)) flag = false;
  }
  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:41: error: 's' was not declared in this scope
   13 |     if(!(h[i] >= h[i - 1] || h[i - 1] - s[i] == 1)) flag = false;
      |                                         ^
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];
  }
  bool flag = true;
  for(int i = n - 1; i > 0; i--){
    if(!(h[i] == h[i - 1] || h[i - 1] - s[i] == 1)) flag = false;
  }
  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:41: error: 's' was not declared in this scope
   13 |     if(!(h[i] == h[i - 1] || h[i - 1] - s[i] == 1)) flag = false;
      |                                         ^
Language: C++

x=int(input())
s=list(map(int,input().split()))
s[0]-=1
for n in range(1,x):
    if s[n]<s[n-1]:
        print('No')
        exit(0)
    s[n]-=1

print('Yes')

Compiler output:
a.cc:6:15: warning: multi-character character constant [-Wmultichar]
    6 |         print('No')
      |               ^~~~
a.cc:10:7: warning: multi-character character constant [-Wmultichar]
   10 | print('Yes')
      |       ^~~~~
a.cc:1:1: error: 'x' does not name a type
    1 | x=int(input())
      | ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9;
using namespace std;
using ll = long long;
int main() {
    int n;
    cin >> n;
    vector <int> h(n);
    for(int i = 0; i < n; i++){
        cin >> h[i];
    }
    bool a = true;
    int t = 0;
    for(int i = 0; i < n; i++){
        if(h[i] - 1 > t){
            t == h[i] - 1;
        }
        else{
            a = false:
        }
    }
    if(a){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:22: error: expected ';' before ':' token
   20 |             a = false:
      |                      ^
      |                      ;
Language: C++

//確認用
#pragma region header
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;
/* ----------------よく使う数字や配列----------------- */
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
constexpr ll mod = 1e9+7;
constexpr ll inf = INT32_MAX/2;
constexpr ll INF = LLONG_MAX/2;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */

/* --------------------テンプレート------------------ */
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
/* ----------------------end----------------------- */

/* --------------------ライブラリ-------------------- */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i;
}
ll gcd(ll a, ll b) {        //最大公約数
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      //最小公倍数
    return a * b / gcd(a, b);
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ----------------------end----------------------- */
#pragma endregion
int main() {
    int N; cin >> N;
    vector<int>H(N);
    rep(i, N) {
        cin >> H[i];
        if (i == 0)continue;
        else if (H[i] < H[i - 1]) {
            if (H[i - 1] - 1 != H[i]) {
                cout << "No" << endl;
                return 0;
            }
                H[i - 1]--;
        }
        else if(H[i]>H[i-1]) H[i]--;
    }
    REP(i, N) {
        if (H[i] < H[i - 1]) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:93:9: error: 'i' was not declared in this scope
   93 |     REP(i, N) {
      |         ^
a.cc:93:5: error: 'REP' was not declared in this scope
   93 |     REP(i, N) {
      |     ^~~
Language: C++

//確認用
#pragma region header
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;
/* ----------------よく使う数字や配列----------------- */
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
constexpr ll mod = 1e9+7;
constexpr ll inf = INT32_MAX/2;
constexpr ll INF = LLONG_MAX/2;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */

/* --------------------テンプレート------------------ */
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
/* ----------------------end----------------------- */

/* --------------------ライブラリ-------------------- */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i;
}
ll gcd(ll a, ll b) {        //最大公約数
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      //最小公倍数
    return a * b / gcd(a, b);
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ----------------------end----------------------- */
#pragma endregion
int main() {
    int n;cin >> n;
    vi h(n);
    rep(i, n) cin >> h[i];
    for(int i=1;i<n ;i++){
		if(a[i]>a[i-1])
			a[i]--;
		else if(a[i]<a[i-1]){
			cout<<"No\n";
			return 0;
		}
	}
    cout << "Yes\n" << endl;
    return 0;
}

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

//確認用
#pragma region header
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;
/* ----------------よく使う数字や配列----------------- */
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
constexpr ll mod = 1e9+7;
constexpr ll inf = INT32_MAX/2;
constexpr ll INF = LLONG_MAX/2;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */

/* --------------------テンプレート------------------ */
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
/* ----------------------end----------------------- */

/* --------------------ライブラリ-------------------- */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i;
}
ll gcd(ll a, ll b) {        //最大公約数
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      //最小公倍数
    return a * b / gcd(a, b);
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ----------------------end----------------------- */
#pragma endregion
int main() {
    int n;cin >> n;
    vi h(n);
    rep(i, n) cin >> h[i];
    rep(i, n) {
        if(i>0) {
            if(h[i-1]-1>h[i]){
                cout << "No" << endl;
                return 0;
            }
            if(h[i-1]-1==h[i]) h[i-1]--;
        }
    }
    // for(auto p:h) cout << p << ' ';
    // cout << endl;
  	h[0]--;
    rep(i, n) {
        if(i>0) {
            if(h[i-1]>h[i]) {
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
    return 0;
}
	h[0]--;

Compiler output:
a.cc:105:9: error: 'h' does not name a type
  105 |         h[0]--;
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
const ll INF=1e18;
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<endl;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b){ a = b; return 1; } return 0; }



int main(int argc, char const *argv[]) {
  cin >> n;
	for (int i = 1; i <= n; i++) cin >> h[i];
	h[1]--;
	for (int i = 2; i <= n; i++) {
		if (h[i] > h[i - 1]) {
			h[i]--;
		}
	}
	bool ok = true;
	for (int i = 1; i < n; i++)
		if (h[i] > h[i + 1]) {
			ok = false;
			break;
		}
	if (ok) cout << "Yes";
	else cout << "No";
	return 0;
  
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:21:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   21 |   cin >> n;
      |          ^
      |          yn
a.cc:22:45: error: 'h' was not declared in this scope
   22 |         for (int i = 1; i <= n; i++) cin >> h[i];
      |                                             ^
a.cc:23:9: error: 'h' was not declared in this scope
   23 |         h[1]--;
      |         ^
Language: Java

import java.util.Scanner;

public class C136 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] A = new int[N];
        int[] B = new int[N+1];

        for(int i = 0; i < N; i++) A[i] = sc.nextInt();
        for(int i = 0; i < N-1; i++) {
            B[i+1] = A[i+1] - A[i];
        }
        
        int res = 0;
        for(int i = 0; i < N+1; i++) {
            if(B[i] < 0) {
                res += B[i];
            }
        }
        if(res < -1) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }
}


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


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const ll INF = 1LL << 60;

int main(){
    int n;
    cin >> n;
    ll high=0;
    for(int i=0; i<n; i++){
        int h;
        cin >> h;
        if(high - 2 >= h){
            cout << "No" << endl;
            return 0;
        }
        high = max(high,h);
    }
    cout << "Yes" << endl;
    return 0;
    

}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:19: error: no matching function for call to 'max(ll&, int&)'
   20 |         high = max(high,h);
      |                ~~~^~~~~~~~
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:2:
/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:20:19: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   20 |         high = max(high,h);
      |                ~~~^~~~~~~~
/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:20:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   20 |         high = max(high,h);
      |                ~~~^~~~~~~~
Language: C++

#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
#define int long long

int n, h[100100];
int32_t main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	cin >> n;
	if (n == 1) {
		cout << "Yes";
		return 0;
	}
	for(int i = 0; i < n; ++i) {
		cin >> h[i];
	}
	for(int i = 1; i < n; ++i) {
		if (i < n-1) {
			if (h[i] => h[i-1] && h[i] > h[i+1]) {
				h[i] = h[i]-1;
				if (h[i] > h[i+1]) {
					cout << "No";
					return 0;
				}
			}
		}
		else {
			if (h[i] < h[i-1]) {
				cout << "No";
				return 0;
			}
		}
	}
	cout << "Yes";
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:20:35: error: expected primary-expression before '>' token
   20 |                         if (h[i] => h[i-1] && h[i] > h[i+1]) {
      |                                   ^
Language: C++

#include <bits/stdc++.h>
#define ll long long

using namespace std;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    int heights[n];
    for (int i = 0; i < n; i++) {
        cin >> heights[i];
    }
    if (n == 1) {
        cout << "Yes";
        return 0;
    }
    for (int i = 0; i < n - 1; i++) {
        if (heights[i] - 1 > heights[i + 1]) {
            cout << "No";
            return 0;
    }
    //Check if valid
    for (int i = 0; i < n - 1; i++) {
        if (heights[i] > heights[i + 1]) {
            cout << "No";
            return 0;
        }
    }
    cout << "Yes";
}


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

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

int main() {
 ll n ;cin >> n;
 vector<ll> h(n);
 rep(i,n)cin >> h[i];
  ll  maxh=h[0]; bool flag=1;
  rep1(i,n){
    if(h[i]<maxh-1)flag=0;
    else if(h[i]>=maxh) maxh=h[i];
  }

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

}


Compiler output:
a.cc:1:1: error: 'clude' does not name a type
    1 | clude <bits/stdc++.h>
      | ^~~~~
a.cc: In function 'int main()':
a.cc:8:8: error: 'cin' was not declared in this scope
    8 |  ll n ;cin >> n;
      |        ^~~
a.cc:9:2: error: 'vector' was not declared in this scope
    9 |  vector<ll> h(n);
      |  ^~~~~~
a.cc:9:11: error: expected primary-expression before '>' token
    9 |  vector<ll> h(n);
      |           ^
a.cc:9:13: error: 'h' was not declared in this scope
    9 |  vector<ll> h(n);
      |             ^
a.cc:17:11: error: 'cout' was not declared in this scope
   17 |   if(flag)cout << "Yes" << endl;
      |           ^~~~
a.cc:17:28: error: 'endl' was not declared in this scope
   17 |   if(flag)cout << "Yes" << endl;
      |                            ^~~~
a.cc:18:8: error: 'cout' was not declared in this scope
   18 |   else cout << "No" << endl;
      |        ^~~~
a.cc:18:24: error: 'endl' was not declared in this scope
   18 |   else cout << "No" << endl;
      |                        ^~~~
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];
  }
  h[0]--;
  for(int i=1;i<n;i++){
    if(a[i]<a[i-1]){
      cout<<"No"<<endl;
      return 0;
    }
    else if(a[i]>a[i-1]){
      a[i]--;
    }
  }
  cout<<"Yes"<<endl;
}
      
      

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

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

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

//#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<cstdio>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<utility>
#include<algorithm>
#include<cstring>
#include<sstream>
#include <iomanip>

using namespace std;

typedef long long ll ;
typedef double db;
typedef vector<ll> vi;
typedef pair<int,int> pii;
typedef vector< pair<int,int> > vii;
const double pi = 2*acos(0) ;

#define pf		  	printf
#define sf			  scanf
#define pb(a)         push_back(a)
#define mp			make_pair
#define fi			 first
#define se			 second
#define for0(i,n)        for(int i=0;i<n;i++)
#define for1(i,n)        for(int i=1;i<=n;i++)
#define forab(i,a,b)       for(int i=a;i<=b;i++)
#define lcm(a, b)     ((a)*((b)/gcd(a,b)))
#define sq(a)		   (a)*(a)
#define nw				"\n"
#define abs(x)		fabs(x)
#define pcase(z,x)    cout<<"Case "<<z<<": "<<x<<"\n"

int main()
{
	ll n,ok=1;
	cin>>n;
	vi a(n);
	for0(i,n) cin>>a[i];
	for0(i,n-1){
		if(a[i]-a[i+1] > 1){ ck=0 ; break;}
		if(a[i]-a[i+1]==1) a[i]--;
		}
	pf(ok? "Yes" :"No");
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:38: error: 'ck' was not declared in this scope; did you mean 'ok'?
   47 |                 if(a[i]-a[i+1] > 1){ ck=0 ; break;}
      |                                      ^~
      |                                      ok
Language: C++

#include <algorithm>
#include <bits/stdc++.h>
#include<iostream>
#include<string>
using namespace std;
#define rep(i, n) for (int i = 0; i <(int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
const ll INF = 1<<29;
int main(){
ll n;cin>>n;
ll h[n];
rep(i,n){cin>>h[i];h[i]--;
bool ok=true;
rep(i,n-1){
   if(h[i]<=h[i+1]+1){
        if(h[i]==h[i+1]+1){
            h[i+1]++;
        }
   }

   else ok=false;
}
if(ok)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}

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

import java.io.*;
 

 
 
public class Main 
{   
	
	
	public static void main(String[] args) throws IOException 
	{ 
		
		
	
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw=new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		StringTokenizer s=new StringTokenizer(br.readLine());
		
		int n=Integer.parseInt(s.nextToken());
		
		int a[]=new int[n];
		
		s=new StringTokenizer(br.readLine());
		for(int i=0;i<n;i++) {
						
			a[i]=Integer.parseInt(s.nextToken());
			
		}
		
		int min[]=new int[n];
		Arrays.fill(min, Integer.MAX_VALUE);
		min[n-1]=a[n-1];
		for(int i=n-2;i>=0;i--) {
			min[i]=Math.min(min[i], min[i+1]);
		}
//		for(int i=0;i<n;i++) {
//			pw.println(min[i]);
//		}
		
		for(int i=n-1;i>=0;i--) {
			if(a[i]-min[i]>1) {
				pw.println("No");
				pw.close();
			}
		}
		pw.println("Yes");
		pw.close();
		
		
	}

}

Compiler output:
Main.java:17: error: cannot find symbol
		StringTokenizer s=new StringTokenizer(br.readLine());
		^
  symbol:   class StringTokenizer
  location: class Main
Main.java:17: error: cannot find symbol
		StringTokenizer s=new StringTokenizer(br.readLine());
		                      ^
  symbol:   class StringTokenizer
  location: class Main
Main.java:23: error: cannot find symbol
		s=new StringTokenizer(br.readLine());
		      ^
  symbol:   class StringTokenizer
  location: class Main
Main.java:31: error: cannot find symbol
		Arrays.fill(min, Integer.MAX_VALUE);
		^
  symbol:   variable Arrays
  location: class Main
4 errors
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;
        bool same =true
        ll cnt=0;
        for(auto i=0;i<num-1;i++){
            if(arr[i]==arr[i+1]){
                cnt += 1;
            }
        }
        if(cnt == num-1) {
            cout<<"No";
            return;
        }

        if(is_sorted(arr.begin(),arr.end())){
            cout<<"Yes";
            return;
        }
        for(auto i=0;i<num-1;i++){
            if(arr[i+1]<arr[i]){
                arr[i]-=1;
            }
        }
        cnt=0;
        for(auto i=0;i<num-1;i++){
            if(arr[i]==arr[i+1]){
                cnt += 1;
            }
        }
        if(cnt == num-1) {
            cout<<"No";
            return;
        }
        if(is_sorted(arr.begin(),arr.end())){
            cout<<"Yes";
            return;
        }
        cout<<"No";
}


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:12:15: error: expected ',' or ';' before 'long'
   12 | #define ll    long long
      |               ^~~~
a.cc:36:9: note: in expansion of macro 'll'
   36 |         ll cnt=0;
      |         ^~
a.cc:39:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   39 |                 cnt += 1;
      |                 ^~~
      |                 int
a.cc:42:12: error: 'cnt' was not declared in this scope; did you mean 'int'?
   42 |         if(cnt == num-1) {
      |            ^~~
      |            int
a.cc:56:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   56 |         cnt=0;
      |         ^~~
      |         int