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

#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll a[100005];
k,first=1;last=9;
int main()
{
	cin>>k;
	for(int i=1;i<=9;i++)a[i]=i;
	if(k<=9)
	{
		cout<<a[k];return 0;
	}
	while(1)
	{
		ll t=a[first];
		for(int i=-1;i<=1;i++)
		{
			if(t%10==0&&i==-1)continue;
			if(t%10==9&&i==1)continue;
			ll nt=t*10+t%10+i;
		    a[++last]=nt;
		    if(last>=k)
		    {
		    	cout<<a[k];return 0;
			}
		}
		first++;
	}
    return 0;
}


Compiler output:
a.cc:5:1: error: 'k' does not name a type
    5 | k,first=1;last=9;
      | ^
a.cc:5:11: error: 'last' does not name a type
    5 | k,first=1;last=9;
      |           ^~~~
a.cc: In function 'int main()':
a.cc:8:14: error: 'k' was not declared in this scope
    8 |         cin>>k;
      |              ^
a.cc:16:24: error: 'first' was not declared in this scope
   16 |                 ll t=a[first];
      |                        ^~~~~
a.cc:22:25: error: 'last' was not declared in this scope
   22 |                     a[++last]=nt;
      |                         ^~~~
Language: C

int main(){
    int k;
    scnaf("%d",&k);
    int l:
    int q={1,2,3,4,5,6,7,8,9,0,0}
    for(int i=0;i<k;i++){
        l=q[0];
        for(int i;i<10;i++){
            q[i]=q[i+1];
        }
        if(l%10!=0)q[8]=10*l+l%10-1;
        q[9]=10*l+l%10;
        if(l%10!=9)q[10]=10*l+l%10+1;
    }
}

Compiler output:
main.c: In function 'main':
main.c:3:5: error: implicit declaration of function 'scnaf' [-Wimplicit-function-declaration]
    3 |     scnaf("%d",&k);
      |     ^~~~~
main.c:4:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
    4 |     int l:
      |          ^
main.c:4:10: error: expected expression before ':' token
Language: C++

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

int main() {
	int k;
	cin>>k;
	queue<ll> lun;
	lun.push(1);
	rep(i,k){
		ll top=lun.front();
		lun.pop();
		if(top%10==0){
			lun.push(top*10);
			lun.push(top*10+1);
		}else if(top%10==9){
			lun.push(top*10+8);
			lun.push(top*10+9);
		}else{
			int a=top%10;
			lun.push(top*10+a-1);
			lun.push(top*10+a);
			lun.push(top*10+a+1);
		}
	}
	
	cout<<lun.fron()<<endl;
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:19: error: 'class std::queue<long long int>' has no member named 'fron'; did you mean 'front'?
   28 |         cout<<lun.fron()<<endl;
      |                   ^~~~
      |                   front
Language: C++

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

int main() {
	int k;
	cin>>k;
	queue<ll> lun;
	lun.push(1);
	rep(i,k){
		ll top=lun.front();
		lun.pop();
		if(top%10==0){
			lun.push(top*10);
			lun.push(top*10+1);
		}else if(top%10==9){
			lun.push(top*10+8);
			lun.push(top*10+9);
		}else{
			int a=top%10;
			lun.push(top*10+a-1);
			lun.push(top*10+a);
			lun.push(top*10+a+1);
		}
	}
	
	cout<<lun.fron<<endl;
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:19: error: 'class std::queue<long long int>' has no member named 'fron'; did you mean 'front'?
   28 |         cout<<lun.fron<<endl;
      |                   ^~~~
      |                   front
Language: C++

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

#define ull unsigned long long
#define endl '\n'
#define ll long long
const int N = 1e2 + 5;
int main(){
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
        if (fopen("VLJUM.INP", "r")){
                freopen("VLJUM.INP", "r", stdin);
                freopen("VLJUM.OUT", "w", stdout);
        }
        ll n, cnt = 0;
        cin >> n;
        queue<ll> pq;
        for (int i = 1; i <= 9; i++){
                pq.push(i);
        }
        while (true){
                ll now = pq.top();
                pq.pop();
                cnt++;
                if (cnt == n) {
                        cout << now;
                        return 0;
                }
                for (int i = 0; i < 10; i++){
                        if (abs((now % 10) - i) <= 1){
                                pq.push(now * 10 + i);
                        }
                }
        }
}
/*
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:23:29: error: 'class std::queue<long long int>' has no member named 'top'; did you mean 'pop'?
   23 |                 ll now = pq.top();
      |                             ^~~
      |                             pop
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int k,first=1,last=9;
ll a[1000005];
int main()
{
for(int i=1,i<=9;i++)
a[i]=i;
cin>>k;
if(k<=9)
{
	cout<<a[i];
	return 0;
	
	
}
while(1)
{
	ll t=a[first];
	for(int i=1;i<=i;i++)
	{
		if(t%10==0&&i==-1)continue;
		if(t%10==9&&i==1)continue;
		ll nt=t*10+t%10+i;
		a[++last]=nt;
		if(last>=k)
		{
			cout<<a[k];
			return 0;
			
		}
		first++;
	}
}
return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: expected ';' before '<=' token
    8 | for(int i=1,i<=9;i++)
      |              ^~
      |              ;
a.cc:8:14: error: expected primary-expression before '<=' token
    8 | for(int i=1,i<=9;i++)
      |              ^~
a.cc:13:17: error: 'i' was not declared in this scope
   13 |         cout<<a[i];
      |                 ^
Language: C++

// 二分探索 + 桁DP
#include <iostream>
#include <vector>
#include <sstream>
#include <string>

using namespace std;
using ll = long long;

bool f(ll x) {
  // x以下のlunlun数の数を返す
  stringstream ss;
  ss << x;
  string str = ss.str();
  int len = str.size();
  vector<vector<vector<ll>>> dp(len+1, vector<vector<ll>>(2, vector<ll>(11, 0)));
  dp[0][0][10] = 1;
  for (int i = 0; i < len; i++) {
   int d = str[i] - '0';
   for (int j = 0; j < 2; j++) {
    for (int k = 0; k <= 10; k++) {
      if (k == 10) {
        for (int l = 1; l <= 10; l++) {
          dp[i+1][j || l < d][l] += dp[i][j][k];
        }
        continue;
      }
      for (int l = -1; l <= 1; l++) {
        int nx = k + l;
        if (nx < 0 || nx >= 10 || (!j && nx > d) continue;
        dp[i+1][j || nx < d][nx] += dp[i][j][k];
      }
    }
   }
  }
  ll ret = 0;
  for (int j = 0; j < 2; j++) for (int k = 0; k < 10; k++) ret += dp[len][j][k];
  return ret;
}

int main() {
  int K;
  cin >> K;
  ll lb = 0;
  ll ub = 1LL << 60;
  while (ub - lb > 1) {
    ll mid = (ub + lb) / 2;
    if (f(mid) >= K) ub = mid;
    else mid = lb;
  }
  cout << ub << endl;
}

Compiler output:
a.cc: In function 'bool f(ll)':
a.cc:30:49: error: expected ';' before 'continue'
   30 |         if (nx < 0 || nx >= 10 || (!j && nx > d) continue;
      |                                                 ^~~~~~~~~
      |                                                 ;
a.cc:31:48: error: expected ')' before ';' token
   31 |         dp[i+1][j || nx < d][nx] += dp[i][j][k];
      |                                                ^
      |                                                )
a.cc:30:12: note: to match this '('
   30 |         if (nx < 0 || nx >= 10 || (!j && nx > d) continue;
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int k;
  cin >> k;
  vector<ll> ans(0);
  rep1(i,9) ans.push_back(i);//1-indexed
  for(int i=0;i<100000;i++){
    int m = ans[i]%10;
    if(m > 0) ans.push_back(10*ans[i] + m - 1);
    ans.push_back(10*ans[i] + m);
    if(m < 9) ans.push_back(10*ans[i] + m + 1);
  }
  cout << ans[k-1] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 'll' was not declared in this scope
    6 |   vector<ll> ans(0);
      |          ^~
a.cc:6:12: error: template argument 1 is invalid
    6 |   vector<ll> ans(0);
      |            ^
a.cc:6:12: error: template argument 2 is invalid
a.cc:7:8: error: 'i' was not declared in this scope
    7 |   rep1(i,9) ans.push_back(i);//1-indexed
      |        ^
a.cc:7:3: error: 'rep1' was not declared in this scope
    7 |   rep1(i,9) ans.push_back(i);//1-indexed
      |   ^~~~
a.cc:9:16: error: invalid types 'int[int]' for array subscript
    9 |     int m = ans[i]%10;
      |                ^
a.cc:10:19: error: request for member 'push_back' in 'ans', which is of non-class type 'int'
   10 |     if(m > 0) ans.push_back(10*ans[i] + m - 1);
      |                   ^~~~~~~~~
a.cc:10:35: error: invalid types 'int[int]' for array subscript
   10 |     if(m > 0) ans.push_back(10*ans[i] + m - 1);
      |                                   ^
a.cc:11:9: error: request for member 'push_back' in 'ans', which is of non-class type 'int'
   11 |     ans.push_back(10*ans[i] + m);
      |         ^~~~~~~~~
a.cc:11:25: error: invalid types 'int[int]' for array subscript
   11 |     ans.push_back(10*ans[i] + m);
      |                         ^
a.cc:12:19: error: request for member 'push_back' in 'ans', which is of non-class type 'int'
   12 |     if(m < 9) ans.push_back(10*ans[i] + m + 1);
      |                   ^~~~~~~~~
a.cc:12:35: error: invalid types 'int[int]' for array subscript
   12 |     if(m < 9) ans.push_back(10*ans[i] + m + 1);
      |                                   ^
a.cc:14:14: error: invalid types 'int[int]' for array subscript
   14 |   cout << ans[k-1] << endl;
      |              ^
Language: C++

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

using ll = long long;

int main() {
  int K;
  cin >> K;
  queue<ll> que;
  for (int i = 1; i <= 9; i++) que.push_back(i);
  	for (int i = 0; i < K-1; i++) {
       int d = que.front(); que.pop_front();
       if (d > 0) que.push_back(d*10+d-1);
      que.push_back(d*10+d);
      if (d < 9) que.push_back(d*10+d+1);
    }
  cout << que.front() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:36: error: 'class std::queue<long long int>' has no member named 'push_back'
   11 |   for (int i = 1; i <= 9; i++) que.push_back(i);
      |                                    ^~~~~~~~~
a.cc:13:33: error: 'class std::queue<long long int>' has no member named 'pop_front'
   13 |        int d = que.front(); que.pop_front();
      |                                 ^~~~~~~~~
a.cc:14:23: error: 'class std::queue<long long int>' has no member named 'push_back'
   14 |        if (d > 0) que.push_back(d*10+d-1);
      |                       ^~~~~~~~~
a.cc:15:11: error: 'class std::queue<long long int>' has no member named 'push_back'
   15 |       que.push_back(d*10+d);
      |           ^~~~~~~~~
a.cc:16:22: error: 'class std::queue<long long int>' has no member named 'push_back'
   16 |       if (d < 9) que.push_back(d*10+d+1);
      |                      ^~~~~~~~~
Language: C++

#include <iostraem>
#include <queue>
using namespace std;
int main()
{
  int K;
  cin >> K;
  if (1<=K && K <= 9) {
    cout << K << endl;
    return 0;
  }
  queue <long long> lunlun;
  for (int i = 1; i <= 9; i++) {
    lunlun.push(i);
  }
  int order = 9;
  for (;;) {
    long long num = lunlun.front();
    lunlun.pop();
    int lsd = num%10;
    int next;
    if (lsd!=0) {
      next = num*10+lsd-1;
      order++;
      if (order==K) {
        cout << next << endl;
        return 0;
      }
      lunlun.push(next);
    }
    next = num*10+lsd;
    order++;
    if (order==K) {
      cout << next << endl;
      return 0;
    }
    lunlun.push(next);
    if (lsd!=9) {
      next = num*10+lsd+1;
      order++;
      if (order==K) {
        cout << next << endl;
        return 0;
      }
      lunlun.push(next);
    }
  }
  return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
  ll i,k;
  cin>>k;
  queue<ll> q;
  for(i=1;i<=9;i++)
    q.push(i);
  i=1;
  while(true)
  {
    ll x=q.front();
    if(i==k)
      break;
    if(x%10!=0)
      q.push(10*x+x%10-1);
    q.push(10*x+x%10);
    if(x%10!=9)
      q.push(10*x+x%10+1);
  }
  cout<<x;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'x' was not declared in this scope
   23 |   cout<<x;
      |         ^
Language: C++

#include<bits/sdc++.h>
using namespace std;
int main()
{
  int k;
  cin>>k;
  
  queue <long long> qq;
  for(int i=1;i<=9;i++)
  {
   qq.push(i);
  }
  int count =0;
  while(1){
    long long x=qq.front();
    count++;
    qq.pop();
    if(count==k){
      cout<<x<<"\n";
      return 0;
    }
    if(x%10!=0)
      qq.push(x*10+x%10-1);
    qq.push(x*10+x%10);
    if(x%10!=9)
      qq.push(x*10+x%10+1);
  }
  
}
    
    
    
    
    
    
    


Compiler output:
a.cc:1:9: fatal error: bits/sdc++.h: No such file or directory
    1 | #include<bits/sdc++.h>
      |         ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/sdc++.h>
using namespace std;
int main()
{
  int k;
  cin>>k;
  
  queue <long long> qq;
  for(int i=1;i<=9;i++)
  {
   qq.push(i);
  }
  int count =0;
  while(1){
    long long x=qq.front();
    count++;
    if(count==k){
      cout<<x<<"\n";
      return 0;
    }
    if(x%10!=0)
      qq.push(x*10+x%10-1);
    qq.push(x*10+x%10);
    if(x%10!=9)
      qq.push(x*10+x%10+1);
  }
  
}
    
    
    
    
    
    
    

Compiler output:
a.cc:1:9: fatal error: bits/sdc++.h: No such file or directory
    1 | #include<bits/sdc++.h>
      |         ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

long long n, a[1000005], cnt = 0;

void dfs(int len, int x, ll num)
{
	if(len == 10) return;
	ll tmp;
	for(int i = -1; i <= 1; i++)
	{
		int y = x + i;
		if(0 <= y && y <= 9)
		{
			tmp = 10 * num + y;
			a[++cnt] = tmp;
			dfs(len + 1, y, tmp);
		}
	}
}

int main()
{
	cin >> n;
	for(int i = 1; i <= 9; i++)
	{
		a[++cnt] = i;
		dfs(1, i, i);
	}
	sort(a + 1, a + cnt + 1);
	cout << a[n] << endl;
	return 0;
}


Compiler output:
a.cc:3:26: error: 'll' has not been declared
    3 | void dfs(int len, int x, ll num)
      |                          ^~
a.cc: In function 'void dfs(int, int, int)':
a.cc:6:9: error: 'll' was not declared in this scope
    6 |         ll tmp;
      |         ^~
a.cc:12:25: error: 'tmp' was not declared in this scope
   12 |                         tmp = 10 * num + y;
      |                         ^~~
a.cc: In function 'int main()':
a.cc:21:9: error: 'cin' was not declared in this scope
   21 |         cin >> n;
      |         ^~~
a.cc:27:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   27 |         sort(a + 1, a + cnt + 1);
      |         ^~~~
      |         short
a.cc:28:9: error: 'cout' was not declared in this scope
   28 |         cout << a[n] << endl;
      |         ^~~~
a.cc:28:25: error: 'endl' was not declared in this scope
   28 |         cout << a[n] << endl;
      |                         ^~~~
Language: C++

long long n, a[N], cnt = 0;

void dfs(int len, int x, ll num)
{
	if(len == 10) return;
	ll tmp;
	for(int i = -1; i <= 1; i++)
	{
		int y = x + i;
		if(0 <= y && y <= 9)
		{
			tmp = 10 * num + y;
			a[++cnt] = tmp;
			dfs(len + 1, y, tmp);
		}
	}
}

int main()
{
	cin >> n;
	for(int i = 1; i <= 9; i++)
	{
		a[++cnt] = i;
		dfs(1, i, i);
	}
	sort(a + 1, a + cnt + 1);
	cout << a[n] << endl;
	return 0;
}


Compiler output:
a.cc:1:16: error: 'N' was not declared in this scope
    1 | long long n, a[N], cnt = 0;
      |                ^
a.cc:3:26: error: 'll' has not been declared
    3 | void dfs(int len, int x, ll num)
      |                          ^~
a.cc: In function 'void dfs(int, int, int)':
a.cc:6:9: error: 'll' was not declared in this scope
    6 |         ll tmp;
      |         ^~
a.cc:12:25: error: 'tmp' was not declared in this scope
   12 |                         tmp = 10 * num + y;
      |                         ^~~
a.cc:13:25: error: 'a' was not declared in this scope
   13 |                         a[++cnt] = tmp;
      |                         ^
a.cc: In function 'int main()':
a.cc:21:9: error: 'cin' was not declared in this scope
   21 |         cin >> n;
      |         ^~~
a.cc:24:17: error: 'a' was not declared in this scope
   24 |                 a[++cnt] = i;
      |                 ^
a.cc:27:14: error: 'a' was not declared in this scope
   27 |         sort(a + 1, a + cnt + 1);
      |              ^
a.cc:27:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   27 |         sort(a + 1, a + cnt + 1);
      |         ^~~~
      |         short
a.cc:28:9: error: 'cout' was not declared in this scope
   28 |         cout << a[n] << endl;
      |         ^~~~
a.cc:28:25: error: 'endl' was not declared in this scope
   28 |         cout << a[n] << endl;
      |                         ^~~~
Language: C++

IDENTIFICATION DIVISION.
PROGRAM-ID. 161D.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 N    PIC 9(6).
01 TBL.
   03 X PIC 9(10) COMP OCCURS 100002.
01 I    PIC 9(06) COMP.
01 L    PIC 9(06) COMP.
01 S    PIC 9(09) COMP.
01 A    PIC 9(01) COMP.
01 OUT  PIC Z(9)9.
*>  
PROCEDURE DIVISION.
  ACCEPT N.
*>
  PERFORM VARYING I FROM 1 BY 1 UNTIL I > 9
    MOVE I TO X(I)
  END-PERFORM.
*>
  MOVE 9 TO L.
  PERFORM VARYING I FROM 1 BY 1 UNTIL I > N OR L >= N
    DIVIDE X(I) BY 10 GIVING S REMAINDER A
    IF (A > 0) THEN
      ADD 1 TO L
      COMPUTE X(L) = X(I) * 10 + A - 1
    END-IF
*>
    ADD 1 TO L
    COMPUTE X(L) = X(I) * 10 + A
*>
    IF (A < 9) THEN
      ADD 1 TO L
      COMPUTE X(L) = X(I) * 10 + A + 1
    END-IF
  END-PERFORM.
*>
  MOVE X(N) TO OUT.
  DISPLAY FUNCTION TRIM(OUT).
*>
  STOP RUN.
 

Compiler output:
a.cc:10:15: error: invalid digit "9" in octal constant
   10 | 01 S    PIC 9(09) COMP.
      |               ^~
a.cc:1:1: error: 'IDENTIFICATION' does not name a type
    1 | IDENTIFICATION DIVISION.
      | ^~~~~~~~~~~~~~
Language: Java

import java.util.Scanner;
import java.util.LinkedList;
import java.lang.Math;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long k = sc.nextLong();
        sc.close();
        LinkedList<Long> list = new LinkedList<Long>();//[1]
        for(long i=1;i<10;i++){
            list.add(i);
        }

        long ans=0;

        for(long i=0;i<k;i++){
            ans = list.get(0);
            list.remove(0);
            if(ans%10 != 0){
                list.add(10*ans+x%10-1);
            }
            list.add(10*ans+x%10);
            if(ans%10 != 9){
                list.add(10*ans+x%10+1);
            }
        }
        System.out.println(ans);
    }
        
    public static int[] sort(int[] a){
        int x;
        for(int i=0;i<a.length;i++){
            x = a[i];
            for(int j=0;j<a.length;j++){
                if(x == Math.max(x,a[j])){
                    a[i]=a[j];
                    a[j]=x;
                    x=a[i];
                }
            }
        }
        return a;
    }
}


Compiler output:
Main.java:21: error: cannot find symbol
                list.add(10*ans+x%10-1);
                                ^
  symbol:   variable x
  location: class Main
Main.java:23: error: cannot find symbol
            list.add(10*ans+x%10);
                            ^
  symbol:   variable x
  location: class Main
Main.java:25: error: cannot find symbol
                list.add(10*ans+x%10+1);
                                ^
  symbol:   variable x
  location: class Main
3 errors
Language: C++

import queue

q = queue.Queue()
for i in range(1,10):
    q.put(i)

k = int(input())
for i in range(k):
    x = q.get()
    if x % 10 != 0:
        q.put(10*x+x%10-1)
    q.put(10*x+x%10)
    if x % 10 != 9:
        q.put(10*x+x%10+1)
    
print(x)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import queue
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll>
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll>
#define ALL(a) (a).begin(),(a).end()
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll k;cin>>k;
  lque q;rep(i,9) q.push(i+1);
  rep(i,k-1) {
    ll t=q.top(),v=t%10;q.pop();
    if(v!=0) q.push(t*10+v-1);
    q.push(t*10+v);
    if(v!=9) q.push(t*10+v+1);
  }
  print(q.top());
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:12: error: 'class std::queue<long long int>' has no member named 'top'; did you mean 'pop'?
   19 |     ll t=q.top(),v=t%10;q.pop();
      |            ^~~
      |            pop
a.cc:20:8: error: 'v' was not declared in this scope
   20 |     if(v!=0) q.push(t*10+v-1);
      |        ^
a.cc:21:17: error: 'v' was not declared in this scope
   21 |     q.push(t*10+v);
      |                 ^
a.cc:24:11: error: 'class std::queue<long long int>' has no member named 'top'; did you mean 'pop'?
   24 |   print(q.top());
      |           ^~~
a.cc:11:27: note: in definition of macro 'print'
   11 | #define print(a) cout << (a) << endl
      |                           ^
Language: C++


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


//define order
int order( long y)
{long x=y;
    int digit=0;
    while(x!=0){
          x /= 10;
          digit++;
      }
    return digit;
}

//define Lunlun
int Lunlun(long x)
{int odr=order(x);
    long y=x;
    vector<int>num(odr);
    for(int i=0;i<odr;i++)
    {num[i]=y%10;y/=10;}
    int crtr=0;
    for(int i=0;i<odr-1;i++)
    {if(max(num[i+1],num[i])-min(num[i+1],num[i])!=0&&max(num[i+1],num[i])-min(num[i+1],num[i])!=1){crtr++;}}
    
      if(crtr>0)
      {return 0;}
      else{return 1;}
    
    
    
    
}

//now we can know if N is a Lunlun number
int main(){
    int N;
    cin>>N;
    //now we got N here
    if(N<10){cout<<N<<endl;}
    if(N>9)
    {int counter=10;
        long answer=9;
        while(counter<=N)
        {answer++;
            counter+=Lunlun(answer);
            }
        cout<<answer<<endl;
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        }
    
    
    

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

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

void dfs(int d, long long val, vector<long long> &all) {
    
    all.push_back(val);

    if(d == 10) return;
   for(int i = -1; i <= 1; i++) {
       int add = (val % 10) + i;
       if(add >= 0 && add <= 9) {
           dfs(d + 1, val * 10 + add, all);
       }
   }
}
int main(){
 int K;
 cin >> K;
 vec<long long> all;
 for(int v = 1; v < 10; v++) dfs(1, v, all);

    sort(all.begin(),all.end());

    cout << all[K - 1];
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:2: error: 'vec' was not declared in this scope
   19 |  vec<long long> all;
      |  ^~~
a.cc:19:6: error: expected primary-expression before 'long'
   19 |  vec<long long> all;
      |      ^~~~
a.cc:20:40: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   20 |  for(int v = 1; v < 10; v++) dfs(1, v, all);
      |                                        ^~~
      |                                        std::filesystem::perms::all
In file included from /usr/include/c++/14/filesystem:51,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
                 from a.cc:1:
/usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here
  158 |       all               =  0777,
      |       ^~~
a.cc:22:10: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   22 |     sort(all.begin(),all.end());
      |          ^~~
      |          std::filesystem::perms::all
/usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here
  158 |       all               =  0777,
      |       ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
 int K;
 cin >> K;
 queue<long long int> p;
 for(int i = 1; i < 10; i++) {
     p.push(i);
 }
 for(int i = 0; i < K - 1; i++) {
     long long s = p.front();
     p.pop();
     for(int j = -1; j <= 1; j++) {
         long long add = (s % 10) + j;
         if(add >= 0 && add <= 9) { que.push(s * 10 + add); }
     }
 }

 cout << p.front() << endl; 
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:37: error: 'que' was not declared in this scope
   15 |          if(add >= 0 && add <= 9) { que.push(s * 10 + add); }
      |                                     ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
 int K;
 cin >> K;
 queue<int> p;
 for(int i = 1; i < 10; i++) {
     p.push(i);
 }
 int sum = 9;
 int a;
 while(sum < K) {
     int num = p.pop();
     a = num * 10 + num % 10;
     p.push(a);
     sum++;
     if(sum == K) { break; }
     a = num * 10 + num % 10 + 1;
     p.push(a);
     sum++;
     if(sum == K) { break; }
     a = num * 10 + num % 10 - 1;
     p.push(a);
     sum++;
 }


 cout << a << endl; 
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: void value not ignored as it ought to be
   13 |      int num = p.pop();
      |                ~~~~~^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
 int K;
 cin >> K;
 queue<int> q;
 for(int i = 1; i < 10; i++) {
     q.push(i);
 }
 int sum = 9;
 int a;
 while(sum < K) {
     int num = p.pop();
     a = num * 10 + num % 10;
     p.push(a);
     sum++;
     if(sum == K) { break; }
     a = num * 10 + num % 10 + 1;
     p.push(a);
     sum++;
     if(sum == K) { break; }
     a = num * 10 + num % 10 - 1;
     p.push(a);
     sum++;
 }


 cout << a << endl; 
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'p' was not declared in this scope
   13 |      int num = p.pop();
      |                ^
Language: C++

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

int A[10];

int Lunlunhantei(int a){
	int i=0;
	while(1){
		a%10=A[i];
		a=a/10;
		if(a==0)break;
		i++;
	}
	if(int j=0;j<i;j++){
		if(abs(A[j]-A[j+1])>1)return 0;
	}
	return 1;
}

int main() {
	int n,count=0,ans=0;
	int i=1;
	cin>>n;
	while(1){
		if(Lunlunhantei(i)){
			count++;
			ans+=i;
			if(count==n)break;
		}
		i++;
	}
	
	cout<<ans<<endl;
	
}


Compiler output:
a.cc: In function 'int Lunlunhantei(int)':
a.cc:10:18: error: lvalue required as left operand of assignment
   10 |                 a%10=A[i];
      |                 ~^~~
a.cc:15:23: error: expected ')' before ';' token
   15 |         if(int j=0;j<i;j++){
      |           ~           ^
      |                       )
a.cc:15:24: error: 'j' was not declared in this scope
   15 |         if(int j=0;j<i;j++){
      |                        ^
Language: C++

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

int A[10];

int Lunlunhantei(int a){
	int i=0;
	while(1){
		a%10=a[i];
		a=a/10;
		if(a==0)break;
		i++;
	}
	if(int j=0;j<i;j++){
		if(abs(a[j]-a[j+1])>1)return 0;
	}
	return 1;
}

int main() {
	int n,count=0,ans=0;
	int i=1;
	cin>>n;
	while(1){
		if(Lunlunhantei(i)){
			count++;
			ans+=i;
			if(count==n)break;
		}
		i++
	}
	
	cout<<ans<<endl;
	
}


Compiler output:
a.cc: In function 'int Lunlunhantei(int)':
a.cc:10:23: error: invalid types 'int[int]' for array subscript
   10 |                 a%10=a[i];
      |                       ^
a.cc:15:23: error: expected ')' before ';' token
   15 |         if(int j=0;j<i;j++){
      |           ~           ^
      |                       )
a.cc:15:24: error: 'j' was not declared in this scope
   15 |         if(int j=0;j<i;j++){
      |                        ^
a.cc: In function 'int main()':
a.cc:31:20: error: expected ';' before '}' token
   31 |                 i++
      |                    ^
      |                    ;
   32 |         }
      |         ~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
void rec(int d,long long val,vector<long long>&all){
  all.push_back(val);
  if(d==10) return;
  for(int j=-1;j<=1;j++){
    int add=(val%10)+j;
    if(add>=0&&add<=9) rec(d+1,val*10+add,all);
  }
}

int main(){
    int k;
    cin>>k;
    vector<long long>all;
    for(int v=1;v<10;++v) rec(1,v,all);
  sort(all.begin(),all.end());
  cout<<all[k-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   18 |   sort(all.begin(),all.end());
      |   ^~~~
      |   short
Language: C++

#include <iostream>
using namespace std;

int lunlun(long long num);

int lunlunAdjacent(long long num,int i);

int getDigit(long long num,int i);

long long pow10(int n);

int lunlunDigit(int dg1,int dg2);

int main(){
 int k;
  cin>>k;
  long long num = 1;
  for(int i= 0; i < k ;num++){
   if(lunlun(num))i++; 
  }
  cout<<num;
  return 0;
}
     
int lunlun(long long num){
	for(int i = 0; num >= pow10(i) ; i++){ //position i has digit 
      if(!lunlunAdjacent(num,i)) return 0;
    }
  return 1;
}

int lunlunAdjacent(long long num,int i){
	//has upper digit (no need to judge)
 // if(num >=  pow10(i+1)){
  //    if(!lunlunDigit(getDigit(num,i+1),getDigit(num,i)))
   //     return 0;
  //  }
  //has lower digit
  if(i-1 >=0){
    if(!lunlunDigit(getDigit(num,i-1),getDigit(num,i)))
      return 0;
  }
  return 1;
}

int getDigit(long long num,int i){//start from 0
	num = (num % pow10(i+1)) /pow10(i);
  return (int)num;
}

long long pow10(int n){ //10^n
	if(n == 0) return 1;
  return pow10(n-1)*10;
}

int lunlunDigit(int dg1,int dg2){
 int diff = dg1-dg2;
  if(diff<=1&&diff>=-1} return 1;
     else return 0;
}


Compiler output:
a.cc: In function 'int lunlunDigit(int, int)':
a.cc:58:23: error: expected ')' before '}' token
   58 |   if(diff<=1&&diff>=-1} return 1;
      |     ~                 ^
      |                       )
a.cc:58:23: error: expected primary-expression before '}' token
a.cc:58:23: warning: no return statement in function returning non-void [-Wreturn-type]
a.cc: At global scope:
a.cc:58:25: error: expected unqualified-id before 'return'
   58 |   if(diff<=1&&diff>=-1} return 1;
      |                         ^~~~~~
a.cc:59:6: error: expected unqualified-id before 'else'
   59 |      else return 0;
      |      ^~~~
a.cc:60:1: error: expected declaration before '}' token
   60 | }
      | ^
Language: C++

#include <iostream>
using namespace std;



int lunlun(long long num){
	for(int i = 0; num >= pow10(i) ; i++){ //position i has digit 
      if(!lunlunAdjacent(num,i)) return 0;
    }
  return 1;
}

int lunlunAdjacent(long long num,int i){
	//has upper digit (no need to judge)
 // if(num >=  pow10(i+1)){
  //    if(!lunlunDigit(getDigit(num,i+1),getDigit(num,i)))
   //     return 0;
  //  }
  //has lower digit
  if(i-1 >=0){
    if(!lunlunDigit(getDigit(num,i-1),getDigit(num,i)))
      return 0;
  }
  return 1;
}

int getDigit(long long num,int i){//start from 0
	num = (num % pow10(i+1)) /pow10(i);
  return (int)num;
}

long long pow10(int n){ //10^n
	if(n == 0) return 1;
  return pow10(n-1)*10;
}

int lunlunDigit(int dg1,int dg2){
 int diff = dg1-dg2;
  if(diff<=1&&diff>=-1} return 1;
     else return 0;
}

int main(){
 int k;
  cin>>k;
  long long num = 1;
  for(int i= 0; i < k ;num++){
   if(lunlun(num))i++; 
  }
  cout<<num;
  return 0;
}

Compiler output:
a.cc: In function 'int lunlun(long long int)':
a.cc:7:31: error: 'pow10' was not declared in this scope
    7 |         for(int i = 0; num >= pow10(i) ; i++){ //position i has digit
      |                               ^~~~~
a.cc:8:11: error: 'lunlunAdjacent' was not declared in this scope
    8 |       if(!lunlunAdjacent(num,i)) return 0;
      |           ^~~~~~~~~~~~~~
a.cc: In function 'int lunlunAdjacent(long long int, int)':
a.cc:21:21: error: 'getDigit' was not declared in this scope
   21 |     if(!lunlunDigit(getDigit(num,i-1),getDigit(num,i)))
      |                     ^~~~~~~~
a.cc:21:9: error: 'lunlunDigit' was not declared in this scope
   21 |     if(!lunlunDigit(getDigit(num,i-1),getDigit(num,i)))
      |         ^~~~~~~~~~~
a.cc: In function 'int getDigit(long long int, int)':
a.cc:28:22: error: 'pow10' was not declared in this scope
   28 |         num = (num % pow10(i+1)) /pow10(i);
      |                      ^~~~~
a.cc: In function 'int lunlunDigit(int, int)':
a.cc:39:23: error: expected ')' before '}' token
   39 |   if(diff<=1&&diff>=-1} return 1;
      |     ~                 ^
      |                       )
a.cc:39:23: error: expected primary-expression before '}' token
a.cc:39:23: warning: no return statement in function returning non-void [-Wreturn-type]
a.cc: At global scope:
a.cc:39:25: error: expected unqualified-id before 'return'
   39 |   if(diff<=1&&diff>=-1} return 1;
      |                         ^~~~~~
a.cc:40:6: error: expected unqualified-id before 'else'
   40 |      else return 0;
      |      ^~~~
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C++

from collections import deque

N = int(input())

D = deque(['1','2','3','4','5','6','7','8','9'])
if N < 10:
  print(list(D)[N-1])
else:
  cnt = 9
  while cnt < N:
    a = D.popleft()
    for k in range(-1, 2):
      _plus = int(a[-1]) + k
      if not(_plus >= 0 and _plus <= 9):
        continue
      u = a + str(_plus)
      D.append(u)
      cnt +=1
      #print(cnt, u)
      if cnt == N:
        print(u)
        break
    else:
      continue
    break

Compiler output:
a.cc:19:8: error: invalid preprocessing directive #print
   19 |       #print(cnt, u)
      |        ^~~~~
a.cc:1:1: error: 'from' does not name a type
    1 | from collections import deque
      | ^~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main() {
  int k;
  cin >> k;
  vector<long long> v;
  for (int i = 1; i <= 9; i++) v.push_back(i);
  
  long long ans;
  
  while (1) {
    
    if (k <= v.size()) {
      ans = v[k - 1];
      break;
    }
    k -= v.size();
    
    vector<long long> w = v;
    v = {};
    for (long long x : w) {
      // 10x + {x-1, x, x+1}
      for (int i = -1; i <= 1; i++) { // -1, 0, +1
        a = x % 10 + i; //
        if (a < 0 || a > 9) continue;
        v.push_back(x * 10 + a);
      }
    }
  }
  
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'a' was not declared in this scope
   25 |         a = x % 10 + i; //
      |         ^
Language: C

//Name: Pankaj Mandrawal (pankaj_m05)
//Problem: OCD
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define INF LLONG_MAX
#define NINF LLONG_MIN
#define mod 10000000009
#define sz(c) int((c).size())
#define sortall(x) sort(all(x))         
#define PI 3.1415926535897932384626     
#define all(c) (c).begin(), (c).end()
#define clr(x) memset(x, 0, sizeof(x))  
#define MAX32 numeric_limits< int >::max() 
#define MIN32 numeric_limits< int >::min()
#define rall(c) (c).rbegin(), (c).rend()
#define deb(x) cerr << #x << " = " << x << endl
#define forn(i, n) for(int i = 0; i < (int)n; ++i)
#define for1(i, n) for(int i = 1; i <= (int) n; ++i)
#define ford(i, n) for(int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, l, r) for(int i = (int)(l); i < (int)(r); ++i)
#define tr(c, it) for(typeof(c).begin() it = c.begin(); it != c.end(); it++)
#define deb2(x, y) cerr << #x << " = " << x << "," << #y << " = " << y << endl

using namespace std;

typedef long long ll;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< ll > vill;
typedef pair < int, int > pi;
typedef unsigned long long int ull;

ll mypow(ll x, ll y) { 
    if (y == 0) 
        return 1; 
    ll p = mypow(x, y / 2) % mod; 
    p = (p * p) % mod; 
    if (!(y & 1)) 
        return p;
    return (p * x) % mod; 
} 

queue< ll > q;

void precomp() {
	for1(it, 9)
		q.push(it);
}
void plssolve() {
	int k; cin >> k;
	if(k < 10) {
		cout << k << '\n';
		return;
	}
	precomp();
	ll ans = 0;
	while(k--) {
		ans = q.front(); q.pop();
		if(ans % 10)
		   q.push((10 * ans + (ans % 10) - 1));
		q.push((10 * ans + (ans % 10)));
		if(ans % 10 != 9) 
			q.push((10 * ans + (ans % 10) + 1));
	}
	cout << ans << '\n';
}

int main(void) {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.precision(10);
    cout << fixed;
    int t = 1;
    // cin >> t;
    while(t--) {
        plssolve();
    }
    return 0;
}

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


#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
#define fi first
#define se second
#define ll long long
#define _for(i,j,k) for(int i=j;i<k;i++)
#define endl  '\n'
#define inf 0x3f3f3f3f
using namespace std;

vector<long long> num;
long long Q[int(1e7)];
int l=1,r=0;
inline void prepare() {
	for(register int i=1;i<10;i++)
		Q[++r]=i;
	while(r>l) {
		long long cur=Q[l++];
		if(cur>1e11) return;
		num.push_back(cur);
		int back=cur%10;
		
		Q[++r]=cur*10ll+back;
		if(back!=0) Q[++r]=cur*10ll+back-1;
		if(back!=9) Q[++r]=cur*10ll+back+1;
	}
}

signed main() {
	prepare();
	int k;
	cin>>k;
	sort(num.begin(),num.end()) ;
	cout<<num[k-1]<<endl;
}

Compiler output:
a.cc:15:1: error: 'vector' does not name a type
   15 | vector<long long> num;
      | ^~~~~~
a.cc: In function 'void prepare()':
a.cc:19:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   19 |         for(register int i=1;i<10;i++)
      |                          ^
a.cc:24:17: error: 'num' was not declared in this scope; did you mean 'enum'?
   24 |                 num.push_back(cur);
      |                 ^~~
      |                 enum
a.cc: In function 'int main()':
a.cc:37:14: error: 'num' was not declared in this scope; did you mean 'enum'?
   37 |         sort(num.begin(),num.end()) ;
      |              ^~~
      |              enum
Language: Java

import java.util.*;
import java.io.*;
public class Solution
{
    public static void main(String args[])throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw=new PrintWriter(System.out);
        int k=Integer.parseInt(br.readLine());
        Queue<Long> queue=new LinkedList<>();
        for(int i=1;i<=9;i++)
        queue.add((long)i);
        long temp=0;
        for(int i=1;i<=k;i++)
        {
            temp=queue.poll();
            if(temp%10!=0)
            {
                queue.add(10*temp+(temp%10)-1);
            }
            queue.add(10*temp+(temp%10));
            if(temp%10!=9)
            queue.add(10*temp+(temp%10)+1);
        }
        pw.println(temp);
        pw.flush();
        pw.close();
    }
}

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

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


int main() {
  int K;
  cin >> K;
  
  if (K <= 9) {
    cout << K << endl;
    return 0;
  }
  else {
    vector<vector<Int>> L(20);
    L[1] = {1,2,3,4,5,6,7,8,9};
    
    for (int i = 1; i < 20; i++) {
      for (int j = 0; j < L[i].size(); j++) {
        Int now = L[i][j];
        Int r = now % 10;
        
        if (r >= 1) L[i+1].push_back(now * 10 + r - 1);
        L[i+1].push_back(now + 10 + r);
        if (r <= 8) L[i+1].push_back(now * 10 + r + 1);
        }
      }
    }
    
    int cnt = 9;
    for (int i = 2; i < 20; i++) {
      if (K <= cnt + L[i].size()) {
        cout << L[i][K - cnt - 1] << endl;
        return 0;
      }
      else {
        cnt += L[i].size();
      }
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:22: error: 'L' was not declared in this scope
   32 |       if (K <= cnt + L[i].size()) {
      |                      ^
a.cc: At global scope:
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C++

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


int main() {
  int K;
  cin >> K;
  
  if (K <= 9) {
    cout << K << endl;
    return 0;
  }
  else {
    vector<vector<Int>> L(20);
    L[1] = {1,2,3,4,5,6,7,8,9};
    
    for (int i = 1; i < 20; i++) {
      for (int j = 0; j < L[i].size(); j++) {
        Int now = L[i][j];
        Int r = now % 10;
        
        if r >= 1 L[i+1].push_back(now * 10 + r - 1);
        L[i+1].push_back(now + 10 + r);
        if r <= 8 L[i+1].push_back(now * 10 + r + 1);
        }
      }
    }
    
    int cnt = 9;
    for (int i = 2; i < 20; i++) {
      if (K <= cnt + L[i].size()) {
        cout << L[i][K - cnt - 1] << endl;
        return 0;
      }
      else {
        cnt += L[i].size();
      }
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: expected '(' before 'r'
   23 |         if r >= 1 L[i+1].push_back(now * 10 + r - 1);
      |            ^
      |            (
a.cc:25:12: error: expected '(' before 'r'
   25 |         if r <= 8 L[i+1].push_back(now * 10 + r + 1);
      |            ^
      |            (
a.cc:32:22: error: 'L' was not declared in this scope
   32 |       if (K <= cnt + L[i].size()) {
      |                      ^
a.cc: At global scope:
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C++

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


int main() {
  int K;
  cin >> K;
  
  if (K <= 9) {
    cout << K << endl;
    return 0;
  }
  else {
    vector<vector<Int>> L(20);
    L[1] = {1,2,3,4,5,6,7,8,9};
    
    for (int i = 1; i < 20; i++) {
      for (int j = 0; j < L[i].size(); j++) {
        for (int d = 0; d < 10; d++) {
          if (L[i][j] % 10 >= d - 1 && L[i][j] % 10 <= d + 1) {
            L[i+1].push_back(L[i][j] * 10 + d);
          }
        }
      }
    }
    
    int cnt = 9;
    for (int i = 2; i < 20; i++) {
      if (K <= cnt + L[i].size()) {
        cout << L[i][K - cnt - 1] << endl;
        return 0;
      }
      else {
        cnt += L[i].size();
      }
    }
  }

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

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


int main() {
  int K;
  cin >> K;
  
  if (K <= 9) {
    cout << K << endl;
    return 0;
  }
  else {
    vector<vector<Int>> L(20);
    L[1] = {1,2,3,4,5,6,7,8,9};
    
    for (int i = 1; i < 20; i++) {
      for (int j = 0; j < L[i].size(); j++) {
        for (int d = 0; d < 10; d++) {
          if (L[i][j] % 10 >= d - 1 && L[i][j] % 10 <= d + 1) {
            L[i+1].push_back(L[i][j] * 10 + d);
          }
        }
      }
    }
    
    int cnt = 9;
    for (int i = 2; i < 20; i++) {
      if (K <= cnt + L[i].size()) {
        cout << L[i][K - cnt - 1] << endl;
        return 0;
      }
      else {
        cnt += L[i].size();
      }
    }


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

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


int main() {
  int K;
  cin >> K;
  
  if (K <= 9) {
    cout << K << endl;
    return 0;
  }
  else {
    vector<vector<Int>> L(20);
    L(1) = {1,2,3,4,5,6,7,8,9};
    
    for (int i = 1; i < 20; i++) {
      for (int j = 0; j < L[i].size(); j++) {
        for (int d = 0; d < 10; d++) {
          if (L[i][j] % 10 >= d - 1 && L[i][j] % 10 <= d + 1) {
            L[i+1].push_back(L[i][j] * 10 + d);
          }
        }
      }
    }
    
    int cnt = 9;
    for (int i = 2; i < 20; i++) {
      if (K <= cnt + L[i].size()) {
        cout << L[i][K - cnt - 1] << endl;
        return 0;
      }
      else {
        cnt += L[i].size();
      }
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:16:6: error: no match for call to '(std::vector<std::vector<long int> >) (int)'
   16 |     L(1) = {1,2,3,4,5,6,7,8,9};
      |     ~^~~
a.cc:37:6: error: expected '}' at end of input
   37 |     }
      |      ^
a.cc:14:8: note: to match this '{'
   14 |   else {
      |        ^
a.cc:37:6: error: expected '}' at end of input
   37 |     }
      |      ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: C++

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

int main() {
  int K;
  cin >> K;
  
  if (K <= 9) {
    cout << K << endl;
    return 0;
  }
  else {
    vector<vector<Int>> L(20);
    L(1) = {1,2,3,4,5,6,7,8,9};
    
    for (int i = 1; i < 20; i++) {
      for (int j = 0; j < L[i].size(); j++) {
        for (int d = 0; d < 10; d++) {
          if (L[i][j] % 10 >= d - 1 && L[i][j] % 10 <= d + 1) {
            L[i+1].push_back(L[i][j] * 10 + d);
          }
        }
      }
    }
    
    int cnt = 9;
    for (int i = 2; i < 20; i++) {
      if (K <= cnt + L[i].size()) {
        cout << L[i][K - cnt - 1] << endl;
        return 0;
      }
      else {
        cnt += L[i].size();
      }
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: 'Int' was not declared in this scope; did you mean 'int'?
   13 |     vector<vector<Int>> L(20);
      |                   ^~~
      |                   int
a.cc:13:19: error: template argument 1 is invalid
a.cc:13:19: error: template argument 2 is invalid
a.cc:13:22: error: template argument 1 is invalid
   13 |     vector<vector<Int>> L(20);
      |                      ^~
a.cc:13:22: error: template argument 2 is invalid
a.cc:14:6: error: 'L' cannot be used as a function
   14 |     L(1) = {1,2,3,4,5,6,7,8,9};
      |     ~^~~
a.cc:17:28: error: invalid types 'int[int]' for array subscript
   17 |       for (int j = 0; j < L[i].size(); j++) {
      |                            ^
a.cc:19:16: error: invalid types 'int[int]' for array subscript
   19 |           if (L[i][j] % 10 >= d - 1 && L[i][j] % 10 <= d + 1) {
      |                ^
a.cc:19:41: error: invalid types 'int[int]' for array subscript
   19 |           if (L[i][j] % 10 >= d - 1 && L[i][j] % 10 <= d + 1) {
      |                                         ^
a.cc:20:14: error: invalid types 'int[int]' for array subscript
   20 |             L[i+1].push_back(L[i][j] * 10 + d);
      |              ^
a.cc:20:31: error: invalid types 'int[int]' for array subscript
   20 |             L[i+1].push_back(L[i][j] * 10 + d);
      |                               ^
a.cc:28:23: error: invalid types 'int[int]' for array subscript
   28 |       if (K <= cnt + L[i].size()) {
      |                       ^
a.cc:29:18: error: invalid types 'int[int]' for array subscript
   29 |         cout << L[i][K - cnt - 1] << endl;
      |                  ^
a.cc:33:17: error: invalid types 'int[int]' for array subscript
   33 |         cnt += L[i].size();
      |                 ^
a.cc:35:6: error: expected '}' at end of input
   35 |     }
      |      ^
a.cc:12:8: note: to match this '{'
   12 |   else {
      |        ^
a.cc:35:6: error: expected '}' at end of input
   35 |     }
      |      ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^