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

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

bool overlap(int a, int b, int c, int d){
  assert( a < b ); assert( c < d );
  int a = 0;
  for ( int i = 0; i < 10000; i++ ) a += i;
  if ( d <= a ) return false;
  if ( b <= c ) return false;
  return true;
}

bool notOverlap(int a, int b, int c, int d){
  return b <= c || d <=a;
}

main(){
  int a, b, s, f, n;
  cin >> a >> b >> n;
  for ( int i = 0; i < n; i++ ){
    cin >> s >> f;
    if ( overlap(a, b, s, f) ){
      cout << 1 << endl;
      return 0;
    } else {
      assert(notOverlap(a, b, s, f));
    }
  }
  cout << 0 << endl;
  return 0;
}




Compiler output:
a.cc: In function 'bool overlap(int, int, int, int)':
a.cc:7:7: error: declaration of 'int a' shadows a parameter
    7 |   int a = 0;
      |       ^
a.cc:5:18: note: 'int a' previously declared here
    5 | bool overlap(int a, int b, int c, int d){
      |              ~~~~^
a.cc: At global scope:
a.cc:18:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   18 | main(){
      | ^~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <queue>
#include <stack>
#include <deque>
#include <bitset>
#include <utility>
#include <functional>
#define rep(i,n) for(int i=0;i<n;++i)

using namespace std;
ll n, m, o, ans = 0, a, b;
int main() {
	cin >> n >> m >> o;
	rep(i, o) {
		cin >> a >> b;
		if (a > n&&a < m) ans = 1;
		else if (b > n&&b < m) ans = 1;
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc:18:1: error: 'll' does not name a type
   18 | ll n, m, o, ans = 0, a, b;
      | ^~
a.cc: In function 'int main()':
a.cc:20:16: error: 'n' was not declared in this scope; did you mean 'yn'?
   20 |         cin >> n >> m >> o;
      |                ^
      |                yn
a.cc:20:21: error: 'm' was not declared in this scope; did you mean 'tm'?
   20 |         cin >> n >> m >> o;
      |                     ^
      |                     tm
a.cc:20:26: error: 'o' was not declared in this scope
   20 |         cin >> n >> m >> o;
      |                          ^
a.cc:22:24: error: 'a' was not declared in this scope
   22 |                 cin >> a >> b;
      |                        ^
a.cc:22:29: error: 'b' was not declared in this scope
   22 |                 cin >> a >> b;
      |                             ^
a.cc:23:35: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |                 if (a > n&&a < m) ans = 1;
      |                                   ^~~
      |                                   abs
a.cc:24:40: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |                 else if (b > n&&b < m) ans = 1;
      |                                        ^~~
      |                                        abs
a.cc:26:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

#include<iostream>
using namespace std;

int main(){

	int a, b, N, s, f;
	int ans = 0;
	cin >> a >> b;
	cin >> N;

	for(int i = 0; i < N; i++){
		cin >> s >> f;
			//同じ時間を使用しているとき
			if(a == s && b == f) ans =1;
			//時間をすでに使用（被っている）させているとき
			for(int j = s+1; j < f; j++){
				if(a == j || b == j) ans = 1;
			}
			//時間の使い過ぎ
			for(int k = a+1; k < b; k++){
				if( k == s || k == f) ans = 1;
	}

	cout << ans << endl;

	return 0;
}


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

#include <iostream>
using namespace std;

vector<pair<int, int> > v;
int main() {
  int a, b, N;
  cin >> a >> b >> N;
  for(int i=0; i<N; i++){
    int s, f;
    cin >> s >> f;
    v.push_back(make_pair(s, f));
  }
  int ans=0;
  for(int i=0; i<N; i++){
    if(v[i].begin() < b && a < v[i].end()) ans=1;
  }
  cout << ans << endl;
}

Compiler output:
a.cc:4:1: error: 'vector' does not name a type
    4 | vector<pair<int, int> > v;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:11:5: error: 'v' was not declared in this scope
   11 |     v.push_back(make_pair(s, f));
      |     ^
a.cc:15:8: error: 'v' was not declared in this scope
   15 |     if(v[i].begin() < b && a < v[i].end()) ans=1;
      |        ^
Language: C++

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

vector<pair<int, int> > v;
int main() {
  int a, b, N;
  cin >> a >> b >> N;
  for(int i=0; i<N; i++){
    int s, f;
    cin >> s >> f;
    v.push_back(make_pair(s, f));
  }
  int ans=0;
  for(int i=0; i<N; i++){
    if(v[i].begin() < b && a < v[i].end()) ans=1;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'begin'
   16 |     if(v[i].begin() < b && a < v[i].end()) ans=1;
      |             ^~~~~
a.cc:16:37: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'end'
   16 |     if(v[i].begin() < b && a < v[i].end()) ans=1;
      |                                     ^~~
Language: C++

#include <iostream>
using namespace std;

bool filled[1005];
int main() {
  int a, b, N;
  cin >> a >> b >> N;
  for(int i=0; i<1005; i++) filled[j]=false
  for(int i=0; i<N; i++){
    int s, f;
    cin >> s >> f;
    for(int j=s; j<f; j++) filled[j]=true;
  }
  int ans=0;
  for(int i=a; i<b; i++){
    if(filled[i]) ans=1;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:36: error: 'j' was not declared in this scope
    8 |   for(int i=0; i<1005; i++) filled[j]=false
      |                                    ^
a.cc:9:16: error: 'i' was not declared in this scope
    9 |   for(int i=0; i<N; i++){
      |                ^
Language: C++

#include<iostream>
using namespace std;
int main() {
	int a, b; cin >> a >> b;
	int n; cin >> n;
	bool b = false;
	for (int i = 0; i < n; i++) {
		int c, d; cin >> c >> d;
		if ((a < c&&c < b) || (a < d&&d < b)) {
			b = true;
		}
	}
	cout << b << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: conflicting declaration 'bool b'
    6 |         bool b = false;
      |              ^
a.cc:4:16: note: previous declaration as 'int b'
    4 |         int a, b; cin >> a >> b;
      |                ^
Language: C++

#include <iostream>

using namespace std;

int main()
{
    int a, b, N;
    cin >> a;
    cin >> b;
    cin >> N;

    int s[N], f[N];

    for (int i=0; i<N; ++i)
    {
        cin >> s[i];
        cin >> f[i];
    }

    sort(s, s+N);
    sort(f, f+N);

    int si = 0;
    int fi = 0;
    int counter = 0;

    for (int i=0;; ++i)
    {
        if (si >= N) break;
        if (fi >= N) break;

        if (f[fi] == i) { --counter; ++fi; }

        if (a <= i && i <= b && counter != 0)
        {
            cout << 1 << endl;
            return 0;
        }

        if (s[si] == i) { ++counter; ++si; }
    }
    
    cout << 0 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   20 |     sort(s, s+N);
      |     ^~~~
      |     short
Language: C++

#include <iostream>

using namespace std;

int main()
{
    int a, b, N;
    cin >> a;
    cin >> b;
    cin >> N;

    int s[N], f[N];

    for (int i=0; i<N; ++i)
    {
        cin >> s[i];
        cin >> f[i];
    }

    sort(s, s+N);
    sort(f, f+N);

    int si = 0;
    int fi = 0;
    int counter = 0;

    for (int i=0;; ++i)
    {
        if (si >= N) break;
        if (fi >= N) break;

        if (f[fi] == i) { --counter; ++fi; }

        if (a <= i && i <= b && counter != 0)
        {
            cout << 1 << endl;
            return 0;
        }

        if (s[si] == i) { ++counter; ++si; }
    }
    
    cout << 0 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   20 |     sort(s, s+N);
      |     ^~~~
      |     short
Language: C++

#include <iostream>

using namespace std;

int main()
{
    int a, b, N;
    cin >> a;
    cin >> b;
    cin >> N;

    int s[N], f[N];

    for (int i=0; i<N; ++i)
    {
        cin >> s[i];
        cin >> f[i];
    }

    sort(s, s+N);
    sort(f, f+N);

    int si = 0;
    int fi = 0;
    int counter = 0;

    for (int i=0; i<1000; ++i)
    {
        if (si >= N) break;
        if (fi >= N) break;

        if (f[fi] == i) { --counter; ++fi; }

        if (a <= i && i <= b && counter != 0)
        {
            cout << 1 << endl;
            return 0;
        }

        if (s[si] == i) { ++counter; ++si; }
    }
    
    cout << 0 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   20 |     sort(s, s+N);
      |     ^~~~
      |     short
Language: C++

#include <iostream>
using namespace std;

int main ()
{
	long a,b,n,aa[100],bb[100];

	cin >> a >> b >> n;
	if (n == 0)
	{
		cout << '0' << endl;
		break;
	}

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

	for (int i = 0; i < n; i++)
	{
		if (aa[i] <= a && bb[i] > a)
		{
			cout << '1' << endl;
			break;
		}
		else if (aa[i] < b && bb[i] >= b)
		{
			cout << '1' << endl;
			break;
		}
		else if (a <= aa[i] && bb[i] <= b)
		{
			cout << '1' << endl;
			break;
		}
		else if (i == n - 1)
		{
			cout << '0' << endl;
		}
	}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: break statement not within loop or switch
   12 |                 break;
      |                 ^~~~~
Language: C++

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

int main(){
  int a,b,N;
  cin >> a >> b >> N;

  int a[1000] = {0};
  int count1 = 0,count2 = 0;
  for(int i = a; i < b; i++){
    a[i] = 1;
    count1++;
  }

  int x,y;
  for(int i = 0; i < N; i++){
    cin >> x >> y;
    for(int i = x; i < y; i++){
      a[i] = 0;
    }
  }

  for(int i = 0; i < 1000; i++){
    if(a[i] == 1)count2++;
  }
  if(count1 == count2)cout << '0' << endl;
  else cout << '1' << endl;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: conflicting declaration 'int a [1000]'
    8 |   int a[1000] = {0};
      |       ^
a.cc:5:7: note: previous declaration as 'int a'
    5 |   int a,b,N;
      |       ^
a.cc:11:6: error: invalid types 'int[int]' for array subscript
   11 |     a[i] = 1;
      |      ^
a.cc:19:8: error: invalid types 'int[int]' for array subscript
   19 |       a[i] = 0;
      |        ^
a.cc:24:9: error: invalid types 'int[int]' for array subscript
   24 |     if(a[i] == 1)count2++;
      |         ^
Language: C++

#include<iostream>
using namespace std;
int main(){
	int a,b,N,s[105],f[105];
	cin >> a>>b>>N;
	for (int i = 0; i < N; i++){
		cin >> s[i] >> f[i];
		if (f[i]>a&&s[i]<b){
			int g = 1;
		}
		else{
			int g = 0;
		}
	}
	if (g == 1){
		cout << "1" << endl;
	}
	else{
		cout << "0" << endl;
	}
	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'g' was not declared in this scope
   15 |         if (g == 1){
      |             ^
Language: C++

#include<iostream>
using namespace std;

int main(){
    short a,b,n;
    cin>>a>>b>>n;
    bool R[10001];
    for(int i=0;i<=10001;i++){
        R[i]=false;
    }
    for(int i=1;i<=n;i++){
        short s,f;
        cin>>s>>f;
        for(int j=s+1;j<=f-1;j++){
            R[j]=true;
        }
    }
    for(int i=a;i<=b;i++){
        if(R[i]==true){
            cout<<1<<endl;
            return 0;
        }
    }
    cout<<0<<endl;
	return 0;	
}
#include<iostream>
using namespace std;

int main(){
    short a,b,n;
    cin>>a>>b>>n;
    bool R[10001];
    for(int i=0;i<=10001;i++){
        R[i]=false;
    }
    for(int i=1;i<=n;i++){
        short s,f;
        cin>>s>>f;
        for(int j=s+1;j<=f-1;j++){
            R[j]=true;
        }
    }
    for(int i=a;i<=b;i++){
        if(R[i]==true){
            cout<<1<<endl;
            return 0;
        }
    }
    cout<<0<<endl;
	return 0;	
}


Compiler output:
a.cc:30:5: error: redefinition of 'int main()'
   30 | int main(){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(){
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a,b,n,k[101],l[101],x=0;
    cin>>a>>b>>n;
    for(int i=0;i<=n;i++){
       cin>>k[i]>>l[i];

       else if(k[i]>a&&l[i]<b){
          x=1;
          break;
       }
    }
    cout<<x<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 'else' without a previous 'if'
    9 |        else if(k[i]>a&&l[i]<b){
      |        ^~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int a,b,n;
  cin >> a >> b >> n;

  bool flg~0;
  for(int i=0; i<n; i++){
    int s,f;
    cin >> s >> f;

    if(f<=a || b<=s){
      continue;
    }else{
      flg=1;
    }
  }

  cout << flg << endl;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected initializer before '~' token
    8 |   bool flg~0;
      |           ^
a.cc:16:7: error: 'flg' was not declared in this scope
   16 |       flg=1;
      |       ^~~
a.cc:20:11: error: 'flg' was not declared in this scope
   20 |   cout << flg << endl;
      |           ^~~
Language: C++

#include<iostream>
#include<algorithm>
int x, y;
int main(){
	std::cin >> x >> y;
	int ans = x + y;
	ans -= __gcd(a, b) - 1;
	std::cout << ans << std::endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: 'a' was not declared in this scope
    7 |         ans -= __gcd(a, b) - 1;
      |                      ^
a.cc:7:25: error: 'b' was not declared in this scope
    7 |         ans -= __gcd(a, b) - 1;
      |                         ^
a.cc:7:16: error: '__gcd' was not declared in this scope; did you mean 'std::__gcd'?
    7 |         ans -= __gcd(a, b) - 1;
      |                ^~~~~
      |                std::__gcd
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: 'std::__gcd' declared here
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
Language: C++

#include<iostream>
using namespace std;
	
int main(){

	int x, y, ans;
	int Line_x, Line_y;
	cin >> x >> y;

	/*  xとyの大きさが同じとき */
	if(x == y){
		Line_x = 2 * x - (x-1);
		Line_y = 2 * y - (y-1);
		ans = Line_x;
	}

	/*  xとyの大きさが違うとき */
	if(x < y){
		swap(x, y);
		Line_x = 2 * x - (x-1);
		Line_y = 2 * y - (y-1);
		ans = Line_x + Line_y - 2;
	}

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



Compiler output:
a.cc:26:9: error: extended character 　 is not valid in an identifier
   26 |         　
      |         ^
a.cc: In function 'int main()':
a.cc:26:9: error: '\U00003000' was not declared in this scope
   26 |         　
      |         ^~
Language: C++

#include <iostream>
using namespace std;

int main() {
	int x,y,count=0,a[1000]={};
	double hiritu;
	cin>>x>>y;
	for(int i=0;i<x+x+1;i++){
		hiritu=0;
		if(i%2==0){
			hiritu=i*y/x;
		}
		if(hiritu%1!=0){
			a[i-1]=1;
			a[i+1]=1;
		}
	}
	for(int i=0;i<x+x+1;i++){
		count=count+a[i];
	}
	cout<<count+x+1<<endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:26: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   13 |                 if(hiritu%1!=0){
      |                    ~~~~~~^~
      |                    |      |
      |                    double int
Language: C++

#include<iostream>
using namespace std;
int main(){
int x,y;
cin>>x>>y;
cout>>x+y+1-gcd(x,y)>>endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: 'gcd' was not declared in this scope
    6 | cout>>x+y+1-gcd(x,y)>>endl;
      |             ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
int x,y;
cin>>x>>y;
cout<<x+y+1-gcd(x,y)>>endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: 'gcd' was not declared in this scope
    6 | cout<<x+y+1-gcd(x,y)>>endl;
      |             ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
int x,y;
cin>>x>>y;
cout<<x+y+1-gcd(x,y)<<endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: 'gcd' was not declared in this scope
    6 | cout<<x+y+1-gcd(x,y)<<endl;
      |             ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
int x,y;
cin>>x>>y;
cout<<x+y+1-__gcd(x,y)<<endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: '__gcd' was not declared in this scope
    6 | cout<<x+y+1-__gcd(x,y)<<endl;
      |             ^~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int a,b;
  double x,y,k;

  cin >> a >> b;
  x = a * 2.0;
  y = b;
  k = a+1 + b+ 1 -2;
  for(int i=1;i<a;i++){
    for(double j=1.0;j<y;j++){
      //cout << i+2.0*(y/x) << endl;
      if(i*2.0*(y/x) == j){
        k--;
        break;
      }
    }
  }
  cout << k << endl;
}

}



Compiler output:
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

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

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

    int d[300000];
    for(int i=0;i<n-1;i++){
        D=max(D,d[i]);

        if(D<10){
            cout<<"no"<<endl;
            return 0;
        }
        D-=10;
    }

    for(int i=n-1;i<0;i++){
        D=max(D,d[i]);

        if(D<10){
            cout<<"no"<<endl;
            return 0;
        }
        D-=10;
    }
    cout<<"yes"<<endl;
    return 0;
}


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

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

int main(){
    int n;
    cin>>n;
    int D;
    for(int i=0;i<n;i++){
        cin>>d[i];
    }

    int d[300000];
    for(int i=0;i<n-1;i++){
        D=max(D,d[i]);

        if(D<10){
            cout<<"no"<<endl;
            return 0;
        }
        D-=10;
    }
    D=0;

    for(int i=n-1;i>0;i--){
        D=max(D,d[i]);

        if(D<10){
            cout<<"no"<<endl;
            return 0;
        }
        D-=10;
    }
    cout<<"yes"<<endl;
    return 0;
}


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

#include<iostream>
using namespace std;

int main()
	{
		
		int n,a[300000]={0},length=0;
		bool hantei1=true,hantei2=true;
		
		cin>>n;
		
		for(int i=0; i<n; i++) cin>>a[i];
		
		for(int i=n-1; i>0; i--){
			if(a[i]<10){
				hantei1=false;
				length=10;
				for(int j=i-1; j>0; j--){
					length+=10;
					if(length>1000000) break;
					if(a[j]>=length){
						hantei1=true;
						break;
						}
					}
				}
			}

		for(int i=0; i<n; i++){
			if(a[i]<10){
				hantei2=false;
				length=10;
				for(int j=i+1; j<n; j++){
					length+=10;
					if(length>1000000) break;
					if(a[j]>=length){
						hantei2=true;
						break;
						}
					}
				}
			}

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

#include <bits/stdc++.h>
using namespace std;
int *d;
int n;
long int max(long int a,int b){
  if(a<b)return b;
  else return a;
}
long int min(long int a,int b){
  if(a<b)return a;
  else return b;
}
string check2(){
  long int canhop=n-1;
  long int nowpos=n-1;

  while (true){
    nowpos=canhop;
    long int oldh=canhop;
    canhop=nowpos-d[nowpos]/10;
    if(canhop<0)return "yes"
    for(int i=nowpos;i>canhop;i--){
      nowpos=min(nowpos,i-d[i]/10);
    }

    if(oldh==canhop)return "no";
    }
}

string check1(){
  long int canhop=0;
  long int nowpos;

  while (true){
    if(nowpos>n-1){
      return check2();
    }
    nowpos=canhop;
    long int oldh=canhop;
    canhop=d[nowpos]/10+nowpos;
    if(canhop<0)canhop=0;
    for(int i=nowpos;i<canhop;i++){
      nowpos=max(nowpos,d[i]/10+i);
    }

    if(oldh==canhop)return "no";
    }
  }



int main(){
  d= new int[300000];

  cin >>n;
  for(int i=0;i<n;i++){
    cin >>d[i];
  }
  cout << check1()<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'std::string check2()':
a.cc:21:29: error: expected ';' before 'for'
   21 |     if(canhop<0)return "yes"
      |                             ^
      |                             ;
   22 |     for(int i=nowpos;i>canhop;i--){
      |     ~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int *d;
int n;
long int max(long int a,int b){
  if(a<b)return b;
  else return a;
}
long int min(long int a,int b){
  if(a<b)return a;
  else return b;
}
string check2(){
  long int canhop=n-1;
  long int nowpos=n-1;

  while (true){
    nowpos=canhop;
    long int oldh=canhop;
    canhop=nowpos-d[nowpos]/10;
    if(canhop<=0)return "yes";
    for(int i=nowpos;i>canhop;i--){
      nowpos=min(nowpos,i-d[i]/10);
    }

    if(oldh==canhop)return "no";
    }
}

string check1(){
  long int canhop=0;
  long int nowpos;

  while (true){
    nowpos=canhop;
    long int oldh=canhop;
    canhop=d[nowpos]/10+nowpos;
    if(canhop>=n-1)return check2();
    for(int i=nowpos;i<canhop;i++){
      nowpos=max(nowpos,d[i]/10+i);
    }

    if(oldh==canhop)return "no";
    }
  }



int main(){
  d= new int[300000];

  cin >>n;
  for(int i=0;i<n;i++){
    cin >>d[i];
  }
  cout << check1()<<endl;
  return 0;
}

  else return b;
}
string check2(){
  long int canhop=n-1;
  long int nowpos=n-1;

  while (true){
    if(nowpos<=0)return check2();
    nowpos=canhop;
    long int oldh=canhop;
    canhop=nowpos-d[nowpos]/10;
    if(canhop<0)return "yes";
    for(int i=nowpos;i>canhop;i--){
      nowpos=min(nowpos,i-d[i]/10);
    }

    if(oldh==canhop)return "no";
    }
}

string check1(){
  long int canhop=0;
  long int nowpos;

  while (true){
    if(nowpos>=n-1){
      return check2();
    }
    nowpos=canhop;
    long int oldh=canhop;
    canhop=d[nowpos]/10+nowpos;
    for(int i=nowpos;i<canhop;i++){
      nowpos=max(nowpos,d[i]/10+i);
    }

    if(oldh==canhop)return "no";
    }
  }



int main(){
  d= new int[300000];

  cin >>n;
  for(int i=0;i<n;i++){
    cin >>d[i];
  }
  cout << check1()<<endl;
  return 0;
}

Compiler output:
a.cc:60:3: error: expected unqualified-id before 'else'
   60 |   else return b;
      |   ^~~~
a.cc:61:1: error: expected declaration before '}' token
   61 | }
      | ^
a.cc:62:8: error: redefinition of 'std::string check2()'
   62 | string check2(){
      |        ^~~~~~
a.cc:13:8: note: 'std::string check2()' previously defined here
   13 | string check2(){
      |        ^~~~~~
a.cc:80:8: error: redefinition of 'std::string check1()'
   80 | string check1(){
      |        ^~~~~~
a.cc:30:8: note: 'std::string check1()' previously defined here
   30 | string check1(){
      |        ^~~~~~
a.cc:101:5: error: redefinition of 'int main()'
  101 | int main(){
      |     ^~~~
a.cc:49:5: note: 'int main()' previously defined here
   49 | int main(){
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n;
int d[1000000];

string check2(){
  int nowpos=n-1;
  int canhop=n-1;
  int minhop=n-1;

  for(int j=0;j<300001){
    canhop=nowpos-d[nowpos]/10;
    if(minhop<=0)return "yes";

    for(int i=nowpos;i>=canhop;i--){
      if(i-d[i]/10<canhop)nowpos=i;
      minhop=min(minhop,i-d[i]/10);
    }

    if(minhop==canhop)return "no";
  }
  return "no";
}

string check1(){
  int nowpos=0;
  int canhop=0;
  int maxhop=0;

  for(int j=0;j<300001;j++){
    canhop=d[nowpos]/10+nowpos;
    if(canhop>=n-1)return check2();

    for(int i=nowpos;i<=canhop;i++){
      if(d[i]/10+i>canhop)nowpos=i;
      maxhop=max(maxhop,d[i]/10+i);
    }

    if(maxhop==canhop)return "no";
  }
  return "no";
}


int main(){
  cin >>n;
  for(int i=0;i<n;i++){
    cin>>d[i];
  }
  cout <<check1()<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'std::string check2()':
a.cc:11:23: error: expected ';' before ')' token
   11 |   for(int j=0;j<300001){
      |                       ^
      |                       ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n;
int d[1000000];

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

int nowpos=0;
  int canhop=0;
  int maxhop=0;

  while(true){
    canhop=d[nowpos]/10+nowpos;
    maxhop=canhop;
    if(canhop>=n-1){


       nowpos=n-1;
   canhop=n-1;
   minhop=n-1;

  while(true){
    canhop=nowpos-d[nowpos]/10;
    minhop=canhop;
    if(minhop<=0){cout << "yes\n"; return 0;}

    for(int i=nowpos;i>=canhop;i--){
      if(i-d[i]/10<canhop){
        nowpos=i;
        minhop=i-d[i]/10;
      }
    }

    if(minhop==canhop){cout << "no\n"; return 0;}
  }



    }

    for(int i=nowpos;i<=canhop;i++){
      if(d[i]/10+i>maxhop){
        nowpos=i;
        maxhop=d[i]/10+i;
      }
    }

    if(maxhop==canhop){cout << "no\n"; return 0;}
  }


  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:4: error: 'minhop' was not declared in this scope; did you mean 'maxhop'?
   24 |    minhop=n-1;
      |    ^~~~~~
      |    maxhop
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n;
int d[1000000];

string check2(){
  int nowpos=n-1;
  int canhop=n-1;
  int minhop=n-1;

  for(int j=0;j<300000;j++){
    canhop=nowpos-d[nowpos]/10;
    minhop=canhop;
    if(canhop<=0)return "yes";

    for(int i=nowpos;i>=canhop;i--){
      if(i-d[i]/10<canhop){
        nowpos=i;
        minhop=i-d[i]/10;
      }
    }

  }
  return "no"
}

string check1(){
  int nowpos=0;
  int canhop=0;
  int maxhop=0;

  for(int j=0;j<300000;j++){
    canhop=d[nowpos]/10+nowpos;
    maxhop=canhop;
    if(canhop>=n-1)return check2();

    for(int i=nowpos;i<=canhop;i++){
      if(d[i]/10+i>=maxhop){
        nowpos=i;
        maxhop=d[i]/10+i;
      }
    }
  }
  return "no"
}

int main(){
  cin >>n;
  for(int i=0;i<n;i++){
    cin>>d[i];
  }
  cout <<check1()<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'std::string check2()':
a.cc:24:14: error: expected ';' before '}' token
   24 |   return "no"
      |              ^
      |              ;
   25 | }
      | ~             
a.cc: In function 'std::string check1()':
a.cc:44:14: error: expected ';' before '}' token
   44 |   return "no"
      |              ^
      |              ;
   45 | }
      | ~
Language: C++

#include <iostream>
using namespace std;

int d[300005];
int main() {
  int N
  cin >> N;
  for(int i=0; i<N; i++) cin >> d[i];
  for(int i=0; i<2; i++) {
    int a=0;
    for(int j=0; j<N; j++) {
      if(a<j*10){
        cout << "no" << endl;
        return 0;
      }
      a=max(a, j*10+d[j]);
    }
    reverse(d, d+N);
  }
  cout << "yes" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'cin'
    7 |   cin >> N;
      |   ^~~
a.cc:8:18: error: 'N' was not declared in this scope
    8 |   for(int i=0; i<N; i++) cin >> d[i];
      |                  ^
a.cc:11:20: error: 'N' was not declared in this scope
   11 |     for(int j=0; j<N; j++) {
      |                    ^
a.cc:18:18: error: 'N' was not declared in this scope
   18 |     reverse(d, d+N);
      |                  ^
a.cc:18:5: error: 'reverse' was not declared in this scope
   18 |     reverse(d, d+N);
      |     ^~~~~~~
Language: C++

#include <iostream>
using namespace std;

int d[300005];
int main() {
  int N;
  cin >> N;
  for(int i=0; i<N; i++) cin >> d[i];
  for(int i=0; i<2; i++) {
    int a=0;
    for(int j=0; j<N; j++) {
      if(a<j*10){
        cout << "no" << endl;
        return 0;
      }
      a=max(a, j*10+d[j]);
    }
    reverse(d, d+N);
  }
  cout << "yes" << endl;
}

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

#include<iostream>
#include<algorithm>
#include<vector>
#define STARTPOINT 1
using namespace std;
bool func(vector<int> &line){
	int power = line.front();
	int place = STARTPOINT;
	while(place!=line.size()){
		if(power<10)return false;
		power = max(power,line[place++]);
	}
	return true;
int main(){
	int N;
	cin>>N;
	vector<int> line(N);
	for(int i=0;i<N;++i){
		cin>line[i];
	}
	vector<int> line2 = line;
	reverse(line2.begin(),line2.end());
	cout<<(func(line)&&func(line2)?"yes":"no")<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'bool func(std::vector<int>&)':
a.cc:14:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   14 | int main(){
      |         ^~
a.cc:14:9: note: remove parentheses to default-initialize a variable
   14 | int main(){
      |         ^~
      |         --
a.cc:14:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:14:11: error: a function-definition is not allowed here before '{' token
   14 | int main(){
      |           ^
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:6:29: note: to match this '{'
    6 | bool func(vector<int> &line){
      |                             ^
Language: C++

#include <iostream>
using namespace std;
int main(){
	int a,m=0,n=0,h=20,j=0;
	cin>>a;
	int map[a]={0};
	for (int A=0;A<a;A++){
		cin>>map[A];
		if (n==0){
			if (map[A]<10){
					m=1;
					cout<<"no"<<endl;
					return 0;
			}
			n=1;
		}
		if (map[A]<10){
			for (int B=A-1;B>=0;B--){
				if (map[B]>=h){
					j=0;
					break;
				}
				j=1;
				h+=10;
			}
			if (j!=0){
				m=1;
				
		}
		h=20;
		j=0;
	}
	if (m==1){
		cout<<"no"<<endl;
		return 0;
	}
	n=0;
	for (int A=a-1;A>=0;A--){
		if (n==0){
			if (map[A]<10){
				m=1;
				cout<<"no"<<endl;
				return 0;
			}
			n=1;
		}
		if (map[A]<10){
			for (int B=A+1;B<a;B++){
				if (map[B]>=h){
					j=0;
					break;
				}
				h+=10;
				j=1;
			}
			if (j!=0) m=1;
		}
		h=20;
		j=0;
	}
	if (m!=1) cout<<"yes"<<endl;
	else cout<<"no"<<endl;
	return 0;
}

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

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

int main{

    int n,h=0,j,c=0;
    cin >> n;
    int d[n];
    
    for(int i = 0; i < n; i++)
    {
        cin >> d[i];
    }
    if (d[0]<10 || d[n-1]<10){
        cout << "no" << endl;
    }
    else
    {
        h=h+d[h]/10;
        j=h;
        
        while(1){
            if(d[h]<10){
                if(c!=0 && j=h){
                    cout<<"no"<< endl;
                    break;
                }
                h--;
                c++;
            }
            else if(d[h]>=10){
                h=h+d[h]/10;
                j=h;
                c=0;
                if(h>n){
                    h=n-1;
                    break;
                }
            }
        }
        c=0;
        while(1){
            if(d[h]<10){
                if(c!=0 && j=h){
                    cout<<"no"<< endl;
                    break;
                }
                h++;
                c++;
            }else if(d[h]>=10){
                h=h+d[h]/10;
                j=h;
                c++;
                if(h<0){
                    cout << "yes" << endl;
                    break;
                }
            }
        }
    }
}


Compiler output:
a.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main{
      |     ^~~~
a.cc:6:5: error: expected primary-expression before 'int'
    6 |     int n,h=0,j,c=0;
      |     ^~~
a.cc:6:5: error: expected '}' before 'int'
a.cc:4:9: note: to match this '{'
    4 | int main{
      |         ^
a.cc:7:5: error: 'cin' does not name a type
    7 |     cin >> n;
      |     ^~~
a.cc:8:11: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |     int d[n];
      |           ^
      |           yn
a.cc:10:5: error: expected unqualified-id before 'for'
   10 |     for(int i = 0; i < n; i++)
      |     ^~~
a.cc:10:20: error: 'i' does not name a type
   10 |     for(int i = 0; i < n; i++)
      |                    ^
a.cc:10:27: error: 'i' does not name a type
   10 |     for(int i = 0; i < n; i++)
      |                           ^
a.cc:14:5: error: expected unqualified-id before 'if'
   14 |     if (d[0]<10 || d[n-1]<10){
      |     ^~
a.cc:17:5: error: expected unqualified-id before 'else'
   17 |     else
      |     ^~~~
a.cc:61:1: error: expected declaration before '}' token
   61 | }
      | ^
Language: C++

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

int main{

    int n,h=0,j,c=0;
    cin >> n;
    int d[n];
    
    for(int i = 0; i < n; i++)
    {
        cin >> d[i];
    }
    if (d[0]<10 || d[n-1]<10){
        cout << "no" << endl;
    }
    else
    {
        h=h+d[h]/10;
        j=h;
        
        while(1){
            if(d[h]<10){
                if(c!=0 && j==h){
                    cout<<"no"<< endl;
                    break;
                }
                h--;
                c++;
            }
            else if(d[h]>=10){
                h=h+d[h]/10;
                j=h;
                c=0;
                if(h>n){
                    h=n-1;
                    break;
                }
            }
        }
        c=0;
        while(1){
            if(d[h]<10){
                if(c!=0 && j==h){
                    cout<<"no"<< endl;
                    break;
                }
                h++;
                c++;
            }else if(d[h]>=10){
                h=h-d[h]/10;
                j=h;
                c++;
                if(h<0){
                    cout << "yes" << endl;
                    break;
                }
            }
        }
    }
}


Compiler output:
a.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main{
      |     ^~~~
a.cc:6:5: error: expected primary-expression before 'int'
    6 |     int n,h=0,j,c=0;
      |     ^~~
a.cc:6:5: error: expected '}' before 'int'
a.cc:4:9: note: to match this '{'
    4 | int main{
      |         ^
a.cc:7:5: error: 'cin' does not name a type
    7 |     cin >> n;
      |     ^~~
a.cc:8:11: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |     int d[n];
      |           ^
      |           yn
a.cc:10:5: error: expected unqualified-id before 'for'
   10 |     for(int i = 0; i < n; i++)
      |     ^~~
a.cc:10:20: error: 'i' does not name a type
   10 |     for(int i = 0; i < n; i++)
      |                    ^
a.cc:10:27: error: 'i' does not name a type
   10 |     for(int i = 0; i < n; i++)
      |                           ^
a.cc:14:5: error: expected unqualified-id before 'if'
   14 |     if (d[0]<10 || d[n-1]<10){
      |     ^~
a.cc:17:5: error: expected unqualified-id before 'else'
   17 |     else
      |     ^~~~
a.cc:61:1: error: expected declaration before '}' token
   61 | }
      | ^
Language: C++

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

int main(){

    int n,h=0,j,c=0;
    cin >> n;
    int d[n];
    
    for(int i = 0; i < n; i++){
        cin >> d[i];
    }
    if (d[0]<10 || d[n-1]<10){
        cout << "no" << endl;
    }
    else{
        C=0;
        h=0;
        h=h+d[h]/10;
        j=h;
        while(1){
            if(c!=0 && j==h){
                    cout<<"no"<< endl;
                    break;
                }
            if(d[h]<10){
                h--;
                c++;
            }
            else{
                h=h+d[h]/10;
                j=h;
                c=0;
                if(h>=n-1){
                    h=n-1;
                    break;
                }
            }
        }
        c=0;
        h=h-d[h]/10;
        j=h;
        while(1){
            if(c!=0 && j==h){
                    cout<<"no"<< endl;
                    break;
                }

            if(d[h]<10){   
                h++;
                c++;
            }else{
                h=h-d[h]/10;
                j=h;
                c=0;
                if(h<=0){
                    cout << "yes" << endl;
                    break;
                }
            }
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'C' was not declared in this scope
   17 |         C=0;
      |         ^
Language: C++

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

int main(){

    int n,h=0,j,c=0;
    cin >> n;
    int d[n];
    
    for(int i = 0; i < n; i++){
        0cin >> d[i];
    }
    
    if (d[0]<10 || d[n-1]<10){
        cout << "no" << endl;
    }
    else{
        c=0;
        h=0;
        h=h+d[h]/10;
        j=h;
        while(1){
            if(c!=0 && j==h){
                cout<<"no"<< endl;
                break;
            }
            if(d[h]<10){
                h--;
                c++;
            }
            else{
                h=h+d[h]/10;
                j=h;
                c=0;
                
            }
            if(h>=n-1){
                h=n-1;
                break;
            }
        }
        c=0;
        h=h-d[h]/10;
        j=h;
        while(1){
            if(c!=0 && j==h){
                    cout<<"no"<< endl;
                    break;
                }

            if(d[h]<10){   
                h++;
                c++;
            }else{
                h=h-d[h]/10;
                j=h;
                c=0;
                
            }
            if(h<=0){
                cout << "yes" << endl;
                break;
            }
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: unable to find numeric literal operator 'operator""cin'
   11 |         0cin >> d[i];
      |         ^~~~
Language: C++

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

int main(){

    int n,h=0,j,c=0;
    cin >> n;
    int d[n];
    
    for(int i = 0; i < n; i++){
        0cin >> d[i];
    }
    
    if (d[0]<10 || d[n-1]<10){
        cout << "no" << endl;
    }
    else{
        c=0;
        h=0;
        h=h+d[h]/10;
        j=h;
        while(1){
            if(c!=0 && j==h){
                cout<<"no"<< endl;
                break;
            }
            if(d[h]<10){
                h--;
                c++;
            }
            else{
                h=h+d[h]/10;
                j=h;
                c=0;
                
            }
            if(h>=n-1){
                h=n-1;
                break;
            }
        }
        c=0;
        h=n-1;
        h=h-d[h]/10;
        j=h;
        while(1){
            if(c!=0 && j==h){
                    cout<<"no"<< endl;
                    break;
                }

            if(d[h]<10){   
                h++;
                c++;
            }else{
                h=h-d[h]/10;
                j=h;
                c=0;
                
            }
            if(h<=0){
                cout << "yes" << endl;
                break;
            }
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: unable to find numeric literal operator 'operator""cin'
   11 |         0cin >> d[i];
      |         ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,,count,c,ans;
  int d[300100]={};
  cin >> n;
  for(int i=0; i<n; i++) cin >> d[i];
  /*for(int i=0; i<n; i++){
    cout << d[i] << " ";
  }*/
  for(int j=0; j<2; j++){
    if(ans==1) break;
    if(j==1) {
      reverse(d,d+n);
      /*for(int i=0; i<n; i++){
        cout << d[i] << " ";
      }*/
    }
    for(int i=0; i<n-1; i++){
      if(d[0] < 10 || d[n-1] < 10){
          ans = 1;
          break;
      }
      c = d[i]/10;
      if(c==0){
      } else {
        count = 0;
        for(int j=1; j<c+1; j++) if(d[i+j]>=10) count++;
      }
      if(count==0){
        ans=1;
        break;
     }
   }
    //cout << ans << endl;
  }
//  cout << ans << endl;
  if(ans==1) cout << "no" << endl;
  else cout << "yes" << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: expected unqualified-id before ',' token
    4 |   int n,,count,c,ans;
      |         ^
Language: C++

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main { 
	public static void main(String[] args) throws Exception { 
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(in.readLine());
		int[] trump = new int[n];
		int i = 0;
		String line;
		for(int u = 0 ; u < n ;u++){
			line = in.readLine();
			trump[i] = Integer.parseInt(line);
			i++;
		}
		
		boolean isok = true;
		
		for(int j = 0 ; j < n ; j++){
			if(trump[j] < 10){
				if(j == 0){
					isok = false;
				}else{
					for(int k = j - 1 ; k >= 0 ; k--){
						if(trump[k] >= (j-k+1)*10){
							isok = true;
							break;
						}else{
							isok = false;
						}
					}
					if(!isok) break;
				}
			}
		}
		if(isok){
			int[] trumpreturn = new int[n];
			for(int y = 0 ; y < n ; y++){
			trumpreturn[y] = trump[n-y-1];
			}
			for(int j = 0 ; j < n ; j++){
				if(trumpreturn[j] < 10){
					if(j == 0){
						isok = false;
					}else{
						for(int k = j - 1 ; k >= 0 ; k--){
							if(trumpreturn[k] >= (j-k+1)*10){
								isok = true;
								break;
							}else{
								isok = false;
							}
						}
						if(!isok) break;
					}
				}
			}
		}
		
		
		String judge;
		if(isok){
			judge = "yes";
		}else{
			judge = "no";
		}
		
			System.out.println(judge);
	}
} 


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.BufferedReader;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.StringTokenizer;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
Language: C++

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

typedef long long ll;
typedef pair<ll, ll> P;

#define pb push_back
#define rep(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, n) for(int i = a; i < (n); i++)
#define mod (ll)(1e9+7)
#define int ll
#define INF 100000000

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

bool check() {
  ll a = d[0];
  FOR(i, 1, n) {
    if (a < i * 10) return false;
    if (a < i * 10 + d[i]) a = i * 10 + d[i];
  }
  return true;
}

signed main() {
	ll n, d[300001] = {0};
  cin >> n;
  rep(i, n) {
    cin >> d[i];
  }
  if (can()) {
    reverse(d, d + n);
    if (can()) {
      cout << "yes" << endl;
      return 0;
    } 
  }
  cout << "no" << endl;
	return 0;
}


Compiler output:
a.cc: In function 'bool check()':
a.cc:21:10: error: 'd' was not declared in this scope
   21 |   ll a = d[0];
      |          ^
a.cc:22:13: error: 'n' was not declared in this scope
   22 |   FOR(i, 1, n) {
      |             ^
a.cc:9:42: note: in definition of macro 'FOR'
    9 | #define FOR(i, a, n) for(int i = a; i < (n); i++)
      |                                          ^
a.cc: In function 'int main()':
a.cc:35:7: error: 'can' was not declared in this scope; did you mean 'tan'?
   35 |   if (can()) {
      |       ^~~
      |       tan
Language: C++

#include <bits/stdc++.h>
using namespace std;
int *d;
int n;
string check2(){
  int canhop=n-1;
  int nowpos=n-1;

  while (true){
    if(nowpos<=0)return "Yes";
    nowpos=canhop;
    long int oldh=canhop;
    canhop=nowpos-d[nowpos]/10;
    if(canhop<0)return "yes";
    for(int i=nowpos;i>canhop;i--){
      nowpos=min(nowpos,i-d[i]/10);
    }

    if(oldh==canhop)return "no";
    }
}

string check1(){
  long int canhop=0;
  long int nowpos;

  while (true){
    if(nowpos>=n-1){
      return check2();
    }
    nowpos=canhop;
    int oldh=canhop;
    canhop=d[nowpos]/10+nowpos;
    for(int i=nowpos;i<canhop;i++){
      nowpos=max(nowpos,d[i]/10+i);
    }

    if(oldh==canhop)return "no";
    }
  }



int main(){
  d= new int[300000];

  cin >>n;
  for(int i=0;i<n;i++){
    cin >>d[i];
  }
  cout << check1()<<endl;
  return 0;
}



Compiler output:
a.cc: In function 'std::string check1()':
a.cc:35:17: error: no matching function for call to 'max(long int&, int)'
   35 |       nowpos=max(nowpos,d[i]/10+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:35:17: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   35 |       nowpos=max(nowpos,d[i]/10+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:35:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   35 |       nowpos=max(nowpos,d[i]/10+i);
      |              ~~~^~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
	int n,d[300000]x=0;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>d[i];
		if(d[i]<10)x=1,break;
		else if(d[i]>=20)i=i+d[i]/10-1;
	}
	for(int i=n;i>=1;i--){
		if(d[i]<10)x=1,break;
		else if(d[i]>=20)i=i-d[i]/10+1;
	}
	if(x==1)cout<<"no"<<endl;
	else cout<<"yes"<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:24: error: expected initializer before 'x'
    4 |         int n,d[300000]x=0;
      |                        ^
a.cc:7:22: error: 'd' was not declared in this scope
    7 |                 cin>>d[i];
      |                      ^
a.cc:8:28: error: 'x' was not declared in this scope
    8 |                 if(d[i]<10)x=1,break;
      |                            ^
a.cc:8:32: error: expected primary-expression before 'break'
    8 |                 if(d[i]<10)x=1,break;
      |                                ^~~~~
a.cc:12:20: error: 'd' was not declared in this scope
   12 |                 if(d[i]<10)x=1,break;
      |                    ^
a.cc:12:28: error: 'x' was not declared in this scope
   12 |                 if(d[i]<10)x=1,break;
      |                            ^
a.cc:12:32: error: expected primary-expression before 'break'
   12 |                 if(d[i]<10)x=1,break;
      |                                ^~~~~
a.cc:15:12: error: 'x' was not declared in this scope
   15 |         if(x==1)cout<<"no"<<endl;
      |            ^