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

std::queue<LL> q;
int k;

int main() {
    for (int i = 1; i <= 9; ++i)    q.push(i);
    read(k);
    for (int i = 1; i < k; ++i) {
        LL a = q.front();
        int dig = a % 10;
        q.pop();
        if (dig != 0)   q.push(a * 10 + dig - 1);
        q.push(a * 10 + dig);
        if (dig != 9)   q.push(a * 10 + dig + 1);
    }
    printf("%lld\n", q.front());
    return 0;
}

Compiler output:
a.cc:1:6: error: 'queue' in namespace 'std' does not name a template type
    1 | std::queue<LL> q;
      |      ^~~~~
a.cc:1:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
  +++ |+#include <queue>
    1 | std::queue<LL> q;
a.cc: In function 'int main()':
a.cc:5:37: error: 'q' was not declared in this scope
    5 |     for (int i = 1; i <= 9; ++i)    q.push(i);
      |                                     ^
a.cc:6:5: error: 'read' was not declared in this scope
    6 |     read(k);
      |     ^~~~
a.cc:8:9: error: 'LL' was not declared in this scope
    8 |         LL a = q.front();
      |         ^~
a.cc:9:19: error: 'a' was not declared in this scope
    9 |         int dig = a % 10;
      |                   ^
a.cc:10:9: error: 'q' was not declared in this scope
   10 |         q.pop();
      |         ^
a.cc:15:22: error: 'q' was not declared in this scope
   15 |     printf("%lld\n", q.front());
      |                      ^
a.cc:15:5: error: 'printf' was not declared in this scope
   15 |     printf("%lld\n", q.front());
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | std::queue<LL> q;
Language: C++

#include<iostream>
#include<bits/stdc++.h>
bool islunlun(long long int num) {
	string str = to_string(num);
	for(int i = 0; i < str.length()-1; i++) {
		if(abs((str[i] -'0') - (str[i+1] - '0')) > 1)
			return false;
	}
	return true;
}
int main()
{
  long long int k;
	cin>>k;
	long long int count = 0;
	long long int i = 1;
	while(true) {
		if(islunlun(i)) {
			count++;
		}
		if(count == k)
			break;
		i++;
	}				
	cout<<i<<endl;			
}

Compiler output:
a.cc: In function 'bool islunlun(long long int)':
a.cc:4:9: error: 'string' was not declared in this scope
    4 |         string str = to_string(num);
      |         ^~~~~~
a.cc:4:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:5:28: error: 'str' was not declared in this scope; did you mean 'std'?
    5 |         for(int i = 0; i < str.length()-1; i++) {
      |                            ^~~
      |                            std
a.cc: In function 'int main()':
a.cc:14:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   14 |         cin>>k;
      |         ^~~
      |         std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:25:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |         cout<<i<<endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:25:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   25 |         cout<<i<<endl;
      |                  ^~~~
      |                  std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
2.#include<queue>
3.using namespace std;
4. 
5.int main(){
6.  int K;
7.  cin >> K;
8.  queue<int> que;
9.  int counter = 0;
10.  
11.  for(int i = 1; i <= 9; i++){
12.    que.push(i);
13.  }
14.  int u;
15.  int lun;
16.  while(true){
17.    int lun = que.front();que.pop();
18.    counter++;
19.    if (counter == K) break; 
20.    if (lun % 10 != 0) {
21.      u = 10*lun + (lun % 10) - 1;
22.      que.push(u);
23.    }
24.    u = 10*lun + (lun % 10);
25.    if (lun % 10 != 9) {
26.      u = 10*lun + (lun % 10) + 1;
27.      que.push(u);
28.    }
29.  }
30.  
31.  cout << lun << endl;
32.}


Compiler output:
a.cc:2:3: error: stray '#' in program
    2 | 2.#include<queue>
      |   ^
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 2.#include<queue>
      | ^~
a.cc:4:1: error: expected unqualified-id before numeric constant
    4 | 4.
      | ^~
Language: C++

k=gets.to_i
l=[0]
z=1
r=[]
while k>0
  if l==[9]*z
    l=[1]+[0]*z
    r=[-1]+[0]*(z-1)
    z+=1
  else
    f=false
    -1.downto(-z+1) do |i|
      if l[i-1]==9&&r[i]<0||l[i-1]<9&&r[i]<1
        r[i]+=1
        l[i]+=1
        (i+1).upto(-1) do |j|
          if l[j-1]==0
            r[j]=0
            l[j]=l[j-1]
          else
            r[j]=-1
            l[j]=l[j-1]-1
          end
        end
        f=true
        break
      end
    end
    if !f
      l[0]+=1
      (-z+1).upto(-1) do |j|
        if l[j-1]==0
          r[j]=0
          l[j]=l[j-1]
        else
          r[j]=-1
          l[j]=l[j-1]-1
        end
      end
    end
  end
  k-=1
end
puts l.join


Compiler output:
a.cc:1:1: error: 'k' does not name a type
    1 | k=gets.to_i
      | ^
Language: C++

k=gets.to_i
l=[0]
z=1
r=[]
while k>0
  if l==[9]*z
    l=[1]+[0]*z
    r=[-1]+[0]*(z-1)
    z+=1
  else
    f=false
    -1.downto(-z+1) do |i|
      if l[i-1]==9&&r[i]<0||l[i-1]<9&&r[i]<1
        r[i]+=1
        l[i]+=1
        (i+1).upto(-1) do |j|
          if l[j-1]==0
            r[j]=0
            l[j]=l[j-1]
          else
            r[j]=-1
            l[j]=l[j-1]-1
          end
        end
        f=true
      end
    end
    if !f
      l[0]+=1
      (-z+1).upto(-1) do |j|
        if l[j-1]==0
          r[j]=0
          l[j]=l[j-1]
        else
          r[j]=-1
          l[j]=l[j-1]-1
        end
      end
    end
  end
  k-=1
end
puts l.join


Compiler output:
a.cc:1:1: error: 'k' does not name a type
    1 | k=gets.to_i
      | ^
Language: C++

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

typedef long long ll;

int main ()
{
	int k;
  	cin >> k;
  	vector <ll> lunlun(k,0);
  	for (int i = 0; i < k; i++)
    {
    	if (i < 10)
        {
        	lunlun(i) = i;
        }
      	else
        {
          	int keta = 0;
          	vector <int> ono();
          	while (i >= 1)
            {
              	int amari = 0;
              	amari = i % 10;
              	ono.push_front(amari)
            	i /= 10;
              	keta++;
            }
        	for (int j = 0; j < keta - 1; j++)
            {
            	if (ono.at(j) - 1 > ono.at(j + 1) || ono.at(j) + 1 < ono.at(j + 1);)
                {
                	break;
                }
              	lunlun(i) = i;
            }
        }
    }
  	cout << lunlun(k - 1) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: no match for call to '(std::vector<long long int>) (int&)'
   15 |                 lunlun(i) = i;
      |                 ~~~~~~^~~
a.cc:20:33: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   20 |                 vector <int> ono();
      |                                 ^~
a.cc:20:33: note: remove parentheses to default-initialize a variable
   20 |                 vector <int> ono();
      |                                 ^~
      |                                 --
a.cc:25:21: error: request for member 'push_front' in 'ono', which is of non-class type 'std::vector<int>()'
   25 |                 ono.push_front(amari)
      |                     ^~~~~~~~~~
a.cc:31:25: error: request for member 'at' in 'ono', which is of non-class type 'std::vector<int>()'
   31 |                 if (ono.at(j) - 1 > ono.at(j + 1) || ono.at(j) + 1 < ono.at(j + 1);)
      |                         ^~
a.cc:31:41: error: request for member 'at' in 'ono', which is of non-class type 'std::vector<int>()'
   31 |                 if (ono.at(j) - 1 > ono.at(j + 1) || ono.at(j) + 1 < ono.at(j + 1);)
      |                                         ^~
a.cc:31:58: error: request for member 'at' in 'ono', which is of non-class type 'std::vector<int>()'
   31 |                 if (ono.at(j) - 1 > ono.at(j + 1) || ono.at(j) + 1 < ono.at(j + 1);)
      |                                                          ^~
a.cc:31:74: error: request for member 'at' in 'ono', which is of non-class type 'std::vector<int>()'
   31 |                 if (ono.at(j) - 1 > ono.at(j + 1) || ono.at(j) + 1 < ono.at(j + 1);)
      |                                                                          ^~
a.cc:31:84: error: expected primary-expression before ')' token
   31 |                 if (ono.at(j) - 1 > ono.at(j + 1) || ono.at(j) + 1 < ono.at(j + 1);)
      |                                                                                    ^
a.cc:35:23: error: no match for call to '(std::vector<long long int>) (int&)'
   35 |                 lunlun(i) = i;
      |                 ~~~~~~^~~
a.cc:39:23: error: no match for call to '(std::vector<long long int>) (int)'
   39 |         cout << lunlun(k - 1) << endl;
      |                 ~~~~~~^~~~~~~
Language: C++

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

typedef long long ll;

int main ()
{
	int k;
  	cin >> k;
  	vector <ll> lunlun(k,0);
  	for (int i = 0; i < k; i++)
    {
    	if (i < 10)
        {
        	lunlun(i) = i;
        }
      	else
        {
          	int keta = 0;
          	vector <int> ono();
          	while (i >= 1)
            {
              	int amari = 0;
              	amari = i % 10;
              	ono.push_front(amari)
            	i /= 10;
              	keta++;
            }
        	for (int j = 0; j < keta; j++)
            {
            	if (ono.at(j) - 1 > ono.at(j + 1) || ono.at(j) + 1 < ono.at(j + 1);)
                {
                	break;
                }
              	lunlun(i) = i;
            }
        }
    }
  	cout << lunlun(k - 1) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: no match for call to '(std::vector<long long int>) (int&)'
   15 |                 lunlun(i) = i;
      |                 ~~~~~~^~~
a.cc:20:33: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   20 |                 vector <int> ono();
      |                                 ^~
a.cc:20:33: note: remove parentheses to default-initialize a variable
   20 |                 vector <int> ono();
      |                                 ^~
      |                                 --
a.cc:25:21: error: request for member 'push_front' in 'ono', which is of non-class type 'std::vector<int>()'
   25 |                 ono.push_front(amari)
      |                     ^~~~~~~~~~
a.cc:31:25: error: request for member 'at' in 'ono', which is of non-class type 'std::vector<int>()'
   31 |                 if (ono.at(j) - 1 > ono.at(j + 1) || ono.at(j) + 1 < ono.at(j + 1);)
      |                         ^~
a.cc:31:41: error: request for member 'at' in 'ono', which is of non-class type 'std::vector<int>()'
   31 |                 if (ono.at(j) - 1 > ono.at(j + 1) || ono.at(j) + 1 < ono.at(j + 1);)
      |                                         ^~
a.cc:31:58: error: request for member 'at' in 'ono', which is of non-class type 'std::vector<int>()'
   31 |                 if (ono.at(j) - 1 > ono.at(j + 1) || ono.at(j) + 1 < ono.at(j + 1);)
      |                                                          ^~
a.cc:31:74: error: request for member 'at' in 'ono', which is of non-class type 'std::vector<int>()'
   31 |                 if (ono.at(j) - 1 > ono.at(j + 1) || ono.at(j) + 1 < ono.at(j + 1);)
      |                                                                          ^~
a.cc:31:84: error: expected primary-expression before ')' token
   31 |                 if (ono.at(j) - 1 > ono.at(j + 1) || ono.at(j) + 1 < ono.at(j + 1);)
      |                                                                                    ^
a.cc:35:23: error: no match for call to '(std::vector<long long int>) (int&)'
   35 |                 lunlun(i) = i;
      |                 ~~~~~~^~~
a.cc:39:23: error: no match for call to '(std::vector<long long int>) (int)'
   39 |         cout << lunlun(k - 1) << endl;
      |                 ~~~~~~^~~~~~~
Language: C++

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

typedef long long ll;

int main ()
{
	ll k;
  	cin >> k;
  	vector <int> lunlun(k,0);
  	for (int i = 0; i < k; i++)
    {
    	if (i < 10)
        {
        	lunlun(i) = i;
        }
      	else
        {
        	for (int j = 0; j < i.size(); j++)
            {
            	if (i.at(j) - 1 > i.at(j + 1) || i.at(j) + 1 < i.at(j + 1);)
                {
                	break;
                }
              	lunlun(i) = i;
            }
        }
    }
  	cout << lunlun(k - 1) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: no match for call to '(std::vector<int>) (int&)'
   15 |                 lunlun(i) = i;
      |                 ~~~~~~^~~
a.cc:19:39: error: request for member 'size' in 'i', which is of non-class type 'int'
   19 |                 for (int j = 0; j < i.size(); j++)
      |                                       ^~~~
a.cc:21:23: error: request for member 'at' in 'i', which is of non-class type 'int'
   21 |                 if (i.at(j) - 1 > i.at(j + 1) || i.at(j) + 1 < i.at(j + 1);)
      |                       ^~
a.cc:21:37: error: request for member 'at' in 'i', which is of non-class type 'int'
   21 |                 if (i.at(j) - 1 > i.at(j + 1) || i.at(j) + 1 < i.at(j + 1);)
      |                                     ^~
a.cc:21:52: error: request for member 'at' in 'i', which is of non-class type 'int'
   21 |                 if (i.at(j) - 1 > i.at(j + 1) || i.at(j) + 1 < i.at(j + 1);)
      |                                                    ^~
a.cc:21:66: error: request for member 'at' in 'i', which is of non-class type 'int'
   21 |                 if (i.at(j) - 1 > i.at(j + 1) || i.at(j) + 1 < i.at(j + 1);)
      |                                                                  ^~
a.cc:21:76: error: expected primary-expression before ')' token
   21 |                 if (i.at(j) - 1 > i.at(j + 1) || i.at(j) + 1 < i.at(j + 1);)
      |                                                                            ^
a.cc:25:23: error: no match for call to '(std::vector<int>) (int&)'
   25 |                 lunlun(i) = i;
      |                 ~~~~~~^~~
a.cc:29:23: error: no match for call to '(std::vector<int>) (ll)'
   29 |         cout << lunlun(k - 1) << endl;
      |                 ~~~~~~^~~~~~~
Language: C++

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

int main(){
  int K,d;
  cin>>K;
  
  vector<int> a(0);  
  for(int i=0;i<N;i++){
    a.push_back(i);		//配列aに1〜9までが入る
  }
  
  while(1){	//while()は()の中が真(1以外)ならループを回す，偽(0)ならループを回さない
    
    if(k<=a.size()){
      cout<<a[k-1]<<endl;	//whileのループの周回数が桁数となる
      return 0;	 			//無限ループを終わらせるためにreturnを行う
    }
    k-=a.size();	//k=k-a.size()と一緒，
    
    vector<int> old;	//次のルンルン数をaに入れたいが，次のルンルン数を作るために前の配列が必要
    swap(old,a);		//前の配列をコピーしつつ，新しい配列を入れるためにaの要素を0個にする
    for(int i=0:old){
      d=i%10;
      for(int j=-1;j<2;j++){
        if(d+j<0||d+j>9){continue;}	//桁上がりあるいは桁下りを起こす
        							//continueは次のループに，breakはループ強制終了
        a.push_back(i*10+d+j);
      }
    }
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'N' was not declared in this scope
   11 |   for(int i=0;i<N;i++){
      |                 ^
a.cc:17:8: error: 'k' was not declared in this scope
   17 |     if(k<=a.size()){
      |        ^
a.cc:21:5: error: 'k' was not declared in this scope
   21 |     k-=a.size();        //k=k-a.size()と一緒，
      |     ^
a.cc:25:14: error: initializer in range-based 'for' loop
   25 |     for(int i=0:old){
      |              ^
Language: C++

import numpy as np
K = int(input())
lis = [1,2,3,4,5,6,7,8,9]
lis = np.array(lis)
  
if K < 10:
  print(K)
    
else:
  count = 9
  sub_count = 0
  while count < K:
    tmp = lis[sub_count]
    if tmp % 10 == 9:
      count += 2
      lis.append(tmp * 10  + 8)
      lis.append(tmp + 9)
      sub_count += 1
    elif  tmp % 10== 0:
      count += 2
      lis.append(tmp * 10 + 0)
      lis.append(tmp * 10 + 1)
      sub_count += 1
    else:
      count += 3
      for i in range(-1,2):
        lis.append(tmp * 10 + tmp % 10 + i)
      sub_count += 1
  print(lis[count-1])


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

#include<bits/stdc++.h>
using namespace std;
const long long maxn=1005;
const long long inf=0x3f3f3f3f;
long long dp[maxn][maxn]; 
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	long long k;
	cin>>k;
	for(long long i=0;i<=9;i++)
		dp[1][i]=1;
	for(long long i=2;i<=10;i++)
		for(long long j=0;j<=9;j++)
			dp[i][j]=dp[i-1][j]+dp[i-1][j+1]+dp[i-1][j-1];
	long long l=0,r=0,flag=0;
	for(long long i=1;i<=10;i++)
	{
		for(long long j=1;j<=9;j++)
		{
			if(dp[i][j]>=k)
			{
				l=i;
				r=j;
				flag=1;
				break;
			}
			else
				k-=dp[i][j];
		}
		if(flag==1)
			break;
	}
	l--;
	queue<long long> q;
	q.push(r);
	while(l!=0)
	{
		if(dp[i][r-1]>=k)
		{
			r--;
			q.push(r);
		}
		else
		{
			k-=dp[i][r-1];
			if(dp[i][r-1]>=k)
				q.push(r);
			else
			{
				k-=dp[i][r];
				r++;
				q.push(r);
			}
		}
		l--;
	}
	while(!q.empty())
	{
		cout<<q.front();
		q.pop();
	}
	return 0;
}




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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: request for member 'push' in 'ans', which is of non-class type 'll' {aka 'long long int'}
   14 |     if(ans%10!=0) ans.push(ans*10 + ans%10 - 1);
      |                       ^~~~
a.cc:15:9: error: request for member 'push' in 'ans', which is of non-class type 'll' {aka 'long long int'}
   15 |     ans.push(ans*10+ans%10);
      |         ^~~~
a.cc:16:23: error: request for member 'push' in 'ans', which is of non-class type 'll' {aka 'long long int'}
   16 |     if(ans%10!=9) ans.push(ans*10 + ans%10 + 1);
      |                       ^~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: request for member 'push' in 'ans', which is of non-class type 'int'
   14 |     if(ans%10!=0) ans.push(ans*10 + ans%10 - 1);
      |                       ^~~~
a.cc:15:9: error: request for member 'push' in 'ans', which is of non-class type 'int'
   15 |     ans.push(ans*10+ans%10);
      |         ^~~~
a.cc:16:23: error: request for member 'push' in 'ans', which is of non-class type 'int'
   16 |     if(ans%10!=9) ans.push(ans*10 + ans%10 + 1);
      |                       ^~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: request for member 'push' in 'ans', which is of non-class type 'int'
   14 |     if(ans%10!=0) ans.push(ans*10 + ans%10 - 1);
      |                       ^~~~
a.cc:15:9: error: request for member 'push' in 'ans', which is of non-class type 'int'
   15 |     ans.push(ans*10+ans%10);
      |         ^~~~
a.cc:16:23: error: request for member 'push' in 'ans', which is of non-class type 'int'
   16 |     if(ans%10!=9) ans.push(ans*10 + ans%10 + 1);
      |                       ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  int k;
  cin>>k;
  queue<ll> q;
  for(int i = 0; i <= 9; i++)
  q.push_back(i);
  int ans;
  for(int i = 0; i < k; i++){
  	ans = q.front();
    q.pop();
    if(ans%10!=0) ans.enqueue(ans*10 + ans%10 - 1);
    ans.enqueue(ans*10+ans%10);
    if(ans%10!=9) ans.enqueue(ans*10 + ans%10 + 1);
  }
  cout<<ans<<"\n";
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'class std::queue<long long int>' has no member named 'push_back'
    9 |   q.push_back(i);
      |     ^~~~~~~~~
a.cc:14:23: error: request for member 'enqueue' in 'ans', which is of non-class type 'int'
   14 |     if(ans%10!=0) ans.enqueue(ans*10 + ans%10 - 1);
      |                       ^~~~~~~
a.cc:15:9: error: request for member 'enqueue' in 'ans', which is of non-class type 'int'
   15 |     ans.enqueue(ans*10+ans%10);
      |         ^~~~~~~
a.cc:16:23: error: request for member 'enqueue' in 'ans', which is of non-class type 'int'
   16 |     if(ans%10!=9) ans.enqueue(ans*10 + ans%10 + 1);
      |                       ^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  int k;
  cin>>k;
  queue<ll> q;
  for(int i = 0; i <= 9; i++)
  q.enqueue(i);
  int ans;
  for(int i = 0; i < k; i++){
  	ans = q.deque();
    if(ans%10!=0) ans.enqueue(ans*10 + ans%10 - 1);
    ans.enqueue(ans*10+ans%10);
    if(ans%10!=9) ans.enqueue(ans*10 + ans%10 + 1);
  }
  cout<<ans<<"\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'class std::queue<long long int>' has no member named 'enqueue'; did you mean 'queue'?
    9 |   q.enqueue(i);
      |     ^~~~~~~
      |     queue
a.cc:12:17: error: 'class std::queue<long long int>' has no member named 'deque'
   12 |         ans = q.deque();
      |                 ^~~~~
a.cc:13:23: error: request for member 'enqueue' in 'ans', which is of non-class type 'int'
   13 |     if(ans%10!=0) ans.enqueue(ans*10 + ans%10 - 1);
      |                       ^~~~~~~
a.cc:14:9: error: request for member 'enqueue' in 'ans', which is of non-class type 'int'
   14 |     ans.enqueue(ans*10+ans%10);
      |         ^~~~~~~
a.cc:15:23: error: request for member 'enqueue' in 'ans', which is of non-class type 'int'
   15 |     if(ans%10!=9) ans.enqueue(ans*10 + ans%10 + 1);
      |                       ^~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
	int k;
	cin >> k;
	long long ans[100000];
	int count = 0,digit = 1,first,last,index;
	for(int j = 1;j<10;j++){
		ans[count] == j;
		count++;
	}
	first = 0;
	last = 8;
	digit++;
	while(count < k){
		index = first;
		while(index <= last && count < k){
			int rest = ans[index] % 10;
			if(rest == 0){
				ans[count] = ans[index]*10;
				count++;
				ans[count] = ans[index]*10+1;
				count++;
			}else if(rest == 9){
				ans[count] = ans[index]*10+9
				count++;
				ans[count] = ans[index]*10+8;
				count++;
			}else{
				ans[count] = ans[index]*10+rest;
				count++;
				ans[count] = ans[index]*10+rest + 1;
				count++;
				ans[count] = ans[index]*10+rest-1;
				count++;
			}
			index++;
		}
		first = last+1;
		last = count-1;
	}
	cout << ans[k-1] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:61: error: expected ';' before 'count'
   26 |                                 ans[count] = ans[index]*10+9
      |                                                             ^
      |                                                             ;
   27 |                                 count++;
      |                                 ~~~~~
Language: C++

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

void next_lunlun(string n)
{
	bool inc=true;
	for(int i=1;i<n.size();i++)
		inc=inc&&n[i]>n[i-1];
	if(inc)
	{
		if(n[0]!='9')
		{
			n[0]++;
			for(int i=1;i<n.size();i++)
				n[i]=max((char)(n[i-1]-1),'0');
			return;
		}
	}
	else
	{
		for(int i=n.size()-1;i>0;i--)
		{
			if(n[i]=n[i-1]&&n[i]!='9')
			{
				n[i]++;
				for(int j=i+1;j<n.size();j++)
					n[j]=max((char)(n[j-1]-1),'0');
				return;
			}
		}
		if(n[0]!='9')
		{
			n[0]++;
			for(int i=1;i<n.size();i++)
				n[i]=max((char)(n[i-1]-1),'0');
			return;
		}
	}
	n="1"+n;
	for(int i=1;i<n.size();i++)
		n[i]='0';
}
int main()
{
	int k;
	cin>>k;
	string lunlun="0";
	for(int i=0;i<k;i++)
		next_lunlun(lunlun);
	cout<<lunlun.str_c;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:22: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'str_c'
   50 |         cout<<lunlun.str_c;
      |                      ^~~~~
Language: C++

#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <numeric>
#include <functional>

using namespace std;
#define ALL(x)              (x).begin(),(x).end()
#define REP(i, n)           for (ll (i) = 0 ; (i) < (ll)(n) ; ++(i))
#define REPN(i, m, n)       for (ll (i) = m ; (i) < (ll)(n) ; ++(i))
#define INF                 (ll)2e9
#define MOD                 (1000 * 1000 * 1000 + 7)
#define Ceil(x, n)          (((((x))+((n)-1))/n))
#define CeilN(x, n)         (((((x))+((n)-1))/n)*n)
#define FloorN(x, n)        ((x)-(x)%(n))
#define IsOdd(x)            (((x)&0x01UL) == 0x01UL)
#define IsEven(x)           (!IsOdd((x)))
#define M_PI                3.14159265358979323846
typedef long long           ll;
typedef pair<ll, ll>	    P;

/*-----------------------------------------------------------------------------
　処理
 -----------------------------------------------------------------------------*/
/* 桁を返す */
ll get_digitVal(ll N, int digitPos)
{
	REP(i, digitPos) {
		N /= 10;
	}
	return N % 10;
}

/* 桁数を返す */
ll find_digits(ll n)
{
	ll digit = 0;

	while (n) {
		n /= 10;
		digit++;
	}
	return digit;
}

// メイン
int main()
{
	ll K;
	cin >> K;
	vector<string> ans(K);
	
	REP(i, 9) {
		ans[i] = i + '1';
	}

	ll i = 9;
	ll ansOne = 1;
	while (i < K) {
		

		string ansStr = to_string(ansOne);
		bool isOk = true;
		REP(j, ansStr.size() - 1) {
			int ketaNow = ansStr[j] - '0';
			int ketaNext = ansStr[j + 1] - '0';
			if (1 < abs(ketaNow - ketaNext)) {
				ll addVal = 1;
				REP(addCnt, j) addVal *= 10;
				ansOne -= ansOne % addVal;
				ansOne += addVal * 8;
				isOk = false;
				break;
			}
		}
		
		if (isOk) {
			ans[i] = ansOne;
			ansOne++;
			i++;
		}
	}

	cout << ans[K - 1] << endl;
	return 0;
}A##

Compiler output:
a.cc:96:3: error: stray '##' in program
   96 | }A##
      |   ^~
a.cc:96:2: error: 'A' does not name a type
   96 | }A##
      |  ^
Language: C++

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int main(){
    ll k,cnt=0;
    cin>>k;
    queue<ll> q;
    for(ll i=1;i<=9;i++){
        cnt++;
        q.push_back(i);
        if(cnt==k){
            cout<<i<<endl;
            return 0;
        }
    }
    while(1){
        ll num=q.front();
        q.pop();
        for(ll i=-1;i<=1;i++){
            ll d=num%10+i;
            if(d<0||d>9) continue;
            cnt++;
            q.push_back(num*10+d);
            if(cnt==k){
                cout<<num*10+d<<endl;
                return 0;
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:11: error: 'class std::queue<long long int>' has no member named 'push_back'
   15 |         q.push_back(i);
      |           ^~~~~~~~~
a.cc:28:15: error: 'class std::queue<long long int>' has no member named 'push_back'
   28 |             q.push_back(num*10+d);
      |               ^~~~~~~~~
Language: C++

k = int(input())
lis = [1,2,3,4,5,6,7,8,9]
i=0
while len(lis) < k:
	m = lis[i]%10
	if m != 0:
		lis.append(int(str(lis[i])+str(m-1)))
	lis.append(int(str(lis[i])+str(m)))
	if m!= 9:
		lis.append(int(str(lis[i])+str(m+1)))
	i+=1
print(lis[k-1])

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

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

int main(){
  ll k,x;
  queue<ll>lnln;
  cin>>k;
  rep(i,9) lnln.push(i+1);
  rep(i,k){
  	x=lnln.front;
  	lnln.pop();
  	if(x%10!=0) lnln.push(10*x+x%10-1);
  	lnln.push(10*x+x%10);
  	if(x%9!=0) lnln.push(10*x+x%10+1);
  }
  cout<<x<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: cannot resolve overloaded function 'front' based on conversion to type 'll' {aka 'long long int'}
   13 |         x=lnln.front;
      |                ^~~~~
Language: C++

#include <bits/stdc++.h>
#define FOR(i, a, n) for(int (i) = (int)(a); (i) < (int)(n); ++(i))
#define FORe(i, a, n) for(int (i) = (int)(a); (i) <= (int)(n); ++(i))
#define rFOR(i, a, n) for(int (i) = (int)(n)-1; (i) >= (int)(a); --(i))
#define REP(i, n) FOR((i), 0, (n))
#define REPe(i, n) FORe((i), 0, (n))
#define rREP(i, n) rFOR((i), 0, (n))
#define rep(i, n) FOR((i), 0, (n))
#define all(v) (v).begin(), (v).end()
using namespace std;
using ll = long long;
using P = pair<int,int>;

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

int main() {
  int k;
  cin >> k;
  vector<ll> a;
  FORe(i, 1, 9) a.push_back(i);
  while (1) {
    if (k <= a.size()) {
      cout << a[k-1] << endl;
      return 0;
    }
    k -= a.size();
    vector<ll> old;
    swap(old, a);
    for (ll x : old) {
      FORe(i, -1, 1) {
        int d = x%10 + i;
        if (d < 0 || d > 9) continue;
        ll nx = x*10 + d;
        a.push_backd(nx);
      }
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:11: error: 'class std::vector<long long int>' has no member named 'push_backd'; did you mean 'push_back'?
   35 |         a.push_backd(nx);
      |           ^~~~~~~~~~
      |           push_back
Language: C++

#include <bits/stdc++.h>
#define FOR(i, a, n) for(int (i) = (int)(a); (i) < (int)(n); ++(i))
#define FORe(i, a, n) for(int (i) = (int)(a); (i) <= (int)(n); ++(i))
#define rFOR(i, a, n) for(int (i) = (int)(n)-1; (i) >= (int)(a); --(i))
#define REP(i, n) FOR((i), 0, (n))
#define REPe(i, n) FORe((i), 0, (n))
#define rREP(i, n) rFOR((i), 0, (n))
#define rep(i, n) FOR((i), 0, (n))
#define all(v) (v).begin(), (v).end()
using namespace std;
using ll = long long;
using P = pair<int,int>;

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

int main() {
  int k;
  cin >> k;
  vector<ll> a;
  FORe(i, 1, 9) a.push_back(i);
  while (1) {
    if (k <= a.size()) {
      cout << a[k-1] << endl;
      retuen 0;
    }
    k -= a.size();
    vector<ll> old;
    swap(old, a);
    foe (ll x : old) {
      FORe(i, -1, 1) {
        int d = x%10 + i;
        if (d < 0 || d > 9) continue;
        ll nx = x*10 + d;
        a.push_backd(nx);
      }
    }
  }


  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:7: error: 'retuen' was not declared in this scope
   25 |       retuen 0;
      |       ^~~~~~
a.cc:30:13: error: expected primary-expression before 'x'
   30 |     foe (ll x : old) {
      |             ^
a.cc:30:5: error: 'foe' was not declared in this scope
   30 |     foe (ll x : old) {
      |     ^~~
Language: C++

import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int k=sc.nextInt();
    Deque<Long> dq=new ArrayDeque<>();
    if(k<10){
      System.out.println(k);
      return;
    }
    for(long i=1;i<10;i++){
      dq.addLast(i);
    }
    long last;
    int cnt=9;
    while(true){
      long x=dq.pollFirst();
      long bi=x%10;
      if(bi!=0){
        last=x*10+bi-1;
        dq.add(last);
        cnt++;
        if(cnt==k){break;}
      }
      last=x*10+bi;
      dq.add(last);
      cnt++;
      if(cnt==k){break;}
      if(bi!=9){
        last=x*10+bi+1;
        dq.add(last);
        cnt++;
        if(cnt==k){break;}
      }
    }
    System.out.println(last);
  }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:9: error: expected ':' before 'static'
    4 |   public static void main(String[] args){
      |         ^~~~~~~
      |         :
a.cc:4:27: error: 'String' has not been declared
    4 |   public static void main(String[] args){
      |                           ^~~~~~
a.cc:4:36: error: expected ',' or '...' before 'args'
    4 |   public static void main(String[] args){
      |                                    ^~~~
a.cc:39:2: error: expected ';' after class definition
   39 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:5: error: 'Scanner' was not declared in this scope
    5 |     Scanner sc=new Scanner(System.in);
      |     ^~~~~~~
a.cc:6:11: error: 'sc' was not declared in this scope
    6 |     int k=sc.nextInt();
      |           ^~
a.cc:7:5: error: 'Deque' was not declared in this scope
    7 |     Deque<Long> dq=new ArrayDeque<>();
      |     ^~~~~
a.cc:7:11: error: 'Long' was not declared in this scope; did you mean 'long'?
    7 |     Deque<Long> dq=new ArrayDeque<>();
      |           ^~~~
      |           long
a.cc:7:17: error: 'dq' was not declared in this scope
    7 |     Deque<Long> dq=new ArrayDeque<>();
      |                 ^~
a.cc:7:24: error: 'ArrayDeque' does not name a type
    7 |     Deque<Long> dq=new ArrayDeque<>();
      |                        ^~~~~~~~~~
a.cc:7:35: error: expected primary-expression before '>' token
    7 |     Deque<Long> dq=new ArrayDeque<>();
      |                                   ^
a.cc:7:37: error: expected primary-expression before ')' token
    7 |     Deque<Long> dq=new ArrayDeque<>();
      |                                     ^
a.cc:9:7: error: 'System' was not declared in this scope
    9 |       System.out.println(k);
      |       ^~~~~~
a.cc:37:5: error: 'System' was not declared in this scope
   37 |     System.out.println(last);
      |     ^~~~~~
Language: C++

include<bits/stdc++.h>
using namespace std;
int main() {
	long long K;
	cin >> K;
	
	queue<long long > q;
	for (int i = 1; i <= 9; i++) q.push(i);
	while (!q.empty()) {
		long long x = q.front(); q.pop();
		K--;
		if (K == 0) { cout << x << endl; break; }
		
		for (int y = (x % 10) - 1; y <= (x % 10) + 1; y++) {
			if (y < 0 || y >= 10) continue;
			q.push(x * 10 + (long long)y);
		}
	}
	return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> K;
      |         ^~~
a.cc:7:9: error: 'queue' was not declared in this scope
    7 |         queue<long long > q;
      |         ^~~~~
a.cc:7:15: error: expected primary-expression before 'long'
    7 |         queue<long long > q;
      |               ^~~~
a.cc:8:38: error: 'q' was not declared in this scope
    8 |         for (int i = 1; i <= 9; i++) q.push(i);
      |                                      ^
a.cc:9:17: error: 'q' was not declared in this scope
    9 |         while (!q.empty()) {
      |                 ^
a.cc:12:31: error: 'cout' was not declared in this scope
   12 |                 if (K == 0) { cout << x << endl; break; }
      |                               ^~~~
a.cc:12:44: error: 'endl' was not declared in this scope
   12 |                 if (K == 0) { cout << x << endl; break; }
      |                                            ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
	deque<int> d;
	int k;cin>>k;
	if(k<=9){
		cout<<k;return 0;
	}
	d.push_back(1);
	d.push_back(0);
	int pos = 0;
	for(int i = 0;i<k;i++){
	int c = abs(d[pos]-d[pos+1]);
	if(c<=1){
		d[pos+1]++;
		if(c>=2){
			d[pos]++;
			d[pos+1]--
		}
	}
	if(d[pos+1]>=10){
		pos++;
		d.push_front(1);
	}
	}
	for(int i = 0;i<pos+2;i++){
		cout<<d[i];
	}
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:18:35: error: expected ';' before '}' token
   18 |                         d[pos+1]--
      |                                   ^
      |                                   ;
   19 |                 }
      |                 ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	deque<int> d;
	int k;cin>>k;
	if(k<=9){
		cout<<k;return 0;
	}
	d.push_back(1);
	d.push_back(0);
	int pos = 0;
	for(int i = 0;i<k;i++){
	int c = abs(d[pos]-d[pos+1]);
	if(c<=1){
		d[pos+1]++;
		if(c>=2){
			d[pos]++;
			d[pos+1]--
		}
	}
	if(d[pos+1]>=10){
		pos++;
		d.push_front(1);
	}
	}
	for(int i = 0;i<pos+2;i++){
		cout<<d[i];
	}
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:18:35: error: expected ';' before '}' token
   18 |                         d[pos+1]--
      |                                   ^
      |                                   ;
   19 |                 }
      |                 ~
Language: C++

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
#define answer(x) cout << x << endl
typedef int64_t Int;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 1000000007;

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

    if (d == 10) {
        return;
    }

    for (int i = -1; i <= 1; i++) {
        int add = (val % 10) + i;

        if (0 <= add && add <= 9) {
            rec(d + 1, val * 10 + add, all);
        }
    }
}

int main() {
    int K;
    cin >> K;
    vector<Int> all;
    for (int v = 1; v < 10; v++) {
        rec(1, v, all);
    }
    sort(all.begin(), all.end());

    cout << all[k - 1] << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:17: error: 'k' was not declared in this scope
   38 |     cout << all[k - 1] << endl;
      |                 ^
Language: C++

#!/usr/bin/env python3
import sys
input = sys.stdin.readline

dp = [[0] * 10 for _ in range(11)]
for i in range(10):
    dp[0][i] = 1
for i in range(1, 11):
    for j in range(0, 10):
        dp[i][j] += dp[i-1][j]
        if j-1 >= 0:
            dp[i][j] += dp[i-1][j-1]
        if j+1 < 10:
            dp[i][j] += dp[i-1][j+1]
    
k = int(input())
ans = ""
ret = 0
lv = 0
for i in range(11):
    if k > sum(dp[i][1:]):
        k -= sum(dp[i][1:])
    else:
        lv = i
        break

lft = 1; rgt = 10 
for l in range(lv, -1, -1):
    for i in range(lft, rgt):
        item = dp[l][i]
        if k > item:
            k -= item
        else:
            lft = max(i - 1, 0)
            rgt = i + 2
            ans += str(i)
            break
print(ans)

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/env python3
      |  ^
a.cc:2:1: error: 'import' does not name a type
    2 | import sys
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:27:10: error: 'rgt' does not name a type
   27 | lft = 1; rgt = 10
      |          ^~~
Language: C++

#include <stdio.h>
#include <string>

using namespace std;
int main(){
  int K;
  scanf("%d", &K);
  int i=0;
  int current_num=0;
  while (i<K) {
    current_num+=1;
    string current_string=to_string(current_num);
    bool flag=true;
    
    for(int m=0;m<current_string.length()-1;m++){
      
      if (abs(stoi(current_string.substr(m, 1))-stoi(current_string.substr(m+1, 1)))>1){
        
        flag=false;
        break;

      }
    }
    if (flag==true){
      i+=1;
    }

  }
  printf("%d\n", current_num);

Compiler output:
a.cc: In function 'int main()':
a.cc:29:31: error: expected '}' at end of input
   29 |   printf("%d\n", current_num);
      |                               ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;
long long key[1000000];
int fro = 0;
int end = 0;
void push(long long a) {
  key[si] = a;
  si ++;
}
long long pop() {
  fro ++;
  return key[fro - 1];
}
int main () {
  int K;
  cin >> K;
  for (int i = 0; i < 9; i ++) push(i + 1);
  long long ans = 0;
  for (int i = 0; i < K; i ++) {
    ans = pop();
    long long ku = ans * 10;
    long long ma = ans % 10;
    if (ma != 0) push(ku + ma - 1);
    push(ku + ma);
    if (ma != 9) push(ku + ma + 1);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'void push(long long int)':
a.cc:7:7: error: 'si' was not declared in this scope
    7 |   key[si] = a;
      |       ^~
Language: C++

// 2020 0404 161 D Lunlun Number
//
#include <algorithm>
#include <complex>
#include <string>
#include <deque>
#include <iostream>
#include <set>
#include <stack>
#include <string>
#include <queue>
#include <utility>
#include <vector>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
typedef long long ll;
typedef pair<int, int> P;
using namespace std;


int main() {
    // K = E5 -> 3.2E9 で愚直に全列挙はむり
    int K;
    cin >> K;
    vector<ll> a;
    for(int i = 1; i <= 9; ++i) a.push_back(i);
    while(1){
        if (K <= a.size()) {
            cout << a[K-1] << endl;
            return 0;
        }
        K -= a.size();
        vector<ll> old;
        swap(old, a);
        for(ll x : old) {
            for (int i = -1; i <= 1; i++){
                int d = x % 10 + i;
                // dの1の位に-1, 0, 1をたしたものをおしりに付け足す
                // 33 -> 332, 333, 334
                if(d < 0 || d > 9) continue;
                ll nx = x*10 + d;
                a.push_back(nx);
            }
        }
    }


    return 0;
}

Compiler output:
a.cc:16:9: error: 'pair' does not name a type
   16 | typedef pair<int, int> P;
      |         ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
#define ll=Long Long
 
int main(){
	int k;
  	cin>>k;
  	vector<ll>a;
  	for(int i=1;i<=9;i++){
    	a.push_back(i);
    }
  	while(1){
    	if(k<=a.size()){
        	cout << a[k-1] << endl;
          	return 0;
        }
      	k-=a.size();
      	vector<ll>old;
      	swap(old,a);
      	for(ll x : old){
        	for(int i=-1;i<=1;i++){
            	int d=x%10_i;
              	if(d<0 || d>9){
                	continue;
                }
              	ll nx=x*10+d;
              	a.push_back(nx);
            }
        }
    }
  	return 0;
}

Compiler output:
a.cc:4:9: warning: ISO C++11 requires whitespace after the macro name
    4 | #define ll=Long Long
      |         ^~
a.cc: In function 'int main()':
a.cc:4:12: error: 'Long' was not declared in this scope; did you mean 'long'?
    4 | #define ll=Long Long
      |            ^~~~
a.cc:9:16: note: in expansion of macro 'll'
    9 |         vector<ll>a;
      |                ^~
a.cc:9:18: error: template argument 1 is invalid
    9 |         vector<ll>a;
      |                  ^
a.cc:9:18: error: template argument 2 is invalid
a.cc:11:11: error: request for member 'push_back' in 'a', which is of non-class type 'int'
   11 |         a.push_back(i);
      |           ^~~~~~~~~
a.cc:14:17: error: request for member 'size' in 'a', which is of non-class type 'int'
   14 |         if(k<=a.size()){
      |                 ^~~~
a.cc:15:26: error: invalid types 'int[int]' for array subscript
   15 |                 cout << a[k-1] << endl;
      |                          ^
a.cc:18:14: error: request for member 'size' in 'a', which is of non-class type 'int'
   18 |         k-=a.size();
      |              ^~~~
a.cc:19:18: error: template argument 1 is invalid
   19 |         vector<ll>old;
      |                  ^
a.cc:19:18: error: template argument 2 is invalid
a.cc:4:11: error: expected primary-expression before '=' token
    4 | #define ll=Long Long
      |           ^
a.cc:21:13: note: in expansion of macro 'll'
   21 |         for(ll x : old){
      |             ^~
a.cc:31:5: error: expected primary-expression before '}' token
   31 |     }
      |     ^
a.cc:30:10: error: expected ';' before '}' token
   30 |         }
      |          ^
      |          ;
   31 |     }
      |     ~     
a.cc:31:5: error: expected primary-expression before '}' token
   31 |     }
      |     ^
a.cc:30:10: error: expected ')' before '}' token
   30 |         }
      |          ^
      |          )
   31 |     }
      |     ~     
a.cc:21:12: note: to match this '('
   21 |         for(ll x : old){
      |            ^
a.cc:31:5: error: expected primary-expression before '}' token
   31 |     }
      |     ^