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

#include <bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define INF 1e15
#define NASH 1e9+7
#define MAXN 200005
using namespace std;
ll n,k;
int main(){
    ios_base::sync_with_stdio(false),cin.tie(0);    
    cin>>n>>k;
    cout<<min(abs(n-k),max(0,k-abs(n-k)))<<endl;
}
/*
*/

Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: no matching function for call to 'max(int, long long int)'
   14 |     cout<<min(abs(n-k),max(0,k-abs(n-k)))<<endl;
      |                        ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:14:27: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   14 |     cout<<min(abs(n-k),max(0,k-abs(n-k)))<<endl;
      |                        ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:14:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   14 |     cout<<min(abs(n-k),max(0,k-abs(n-k)))<<endl;
      |                        ~~~^~~~~~~~~~~~~~
Language: C

#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll GCD(ll a, ll b){ return a ? GCD(b % a, a) : b; }
int main(){
    ll n,k;
    cin>>n>>k;
    ll b=n%k;
    cout<<min(b,abs(b-k))<<endl;
}

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

#include "stdafx.h"
#include <bits/stdc++.h>
#define f(i,n) for(int i=0;i<n;i++)
#define P pair<int,int>
#define F first
#define S second
#define int long long
#define mod 1000000007
#define mmod 998244353
#define all(v) v.begin(), v.end()
#define INF LLONG_MAX/3
using namespace std;
int mypow(int a, int b, int c) {
	if (b == 0)return 1;
	if (b % 2)return mypow(a, b - 1, c)*a%c;
	int z = mypow(a, b / 2, c);
	return z * z%c;
}
int x[100000];
signed main() {
	int a, b;
	cin >> a >> b;
	cout << min(a%b, b - a % b) << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int N;cin>>N;
  queue<int>A;
  for(int i=1;i<10;i++)A.push(i);
  for(int i=1;i<N;i++){
    int a=A.top();
    A.pop();
    if(a%10!=0)A.push(a*10+a%10-1);
    A.push(a*10+a%10);
    if(a%10!+9)A.push(a*10+a%10+1);
  }
  cout<<A.top()<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'class std::queue<long long int>' has no member named 'top'; did you mean 'pop'?
    9 |     int a=A.top();
      |             ^~~
      |             pop
a.cc:13:12: error: expected ')' before '!' token
   13 |     if(a%10!+9)A.push(a*10+a%10+1);
      |       ~    ^
      |            )
a.cc:15:11: error: 'class std::queue<long long int>' has no member named 'top'; did you mean 'pop'?
   15 |   cout<<A.top()<<endl;
      |           ^~~
      |           pop
Language: C++

#include <bits/stdc++.h>
// clang-format off
using namespace std; using ll = int64_t; using ull = uint64_t; const ll INF = 9e18;
void print() { cout << endl; }
template<typename Head,typename... Tail> void print(Head head,Tail... tail){cout<<head;if(sizeof...(Tail)>0)cout<<" ";print(tail...);}
void print0() {}
template<typename Head,typename... Tail> void print0(Head head,Tail... tail){cout<<head;print0(tail...);}
// clang-format on

bool dfs(ll keta, ll top, ll &total, vector<char> &chars, ll K) {
    if (keta == -1) {
        total++;
        if (total == K) {
            for (ll s = chars.size() - 1; s >= 0; s--) {
                print0(chars[s]);
            }
            print();
            return true;
        }
        return false;
    }
    if (top > 0) {
        chars[keta] = (char)top + '0' - 1;
        if (dfs(keta - 1, top - 1, total, chars, K)){
            return true;
        }
    }
    chars[keta] = (char)top + '0';
    if (dfs(keta - 1, top, total, chars, K)) {
        return true;
    }
    if (top < 9) {
        chars[keta] = (char)top + '0' + 1;
        if (dfs(keta - 1, top + 1, total, chars, K)) {
            return true;
        }
    }
    return false;
}
int main() {
    ll K;
    cin >> K;
    ll total = 0;
    for (ll keta = 1; true; keta++) {
        vector<char> chars(keta);
        for (ll top = 1; top <= 9; top++) {
            chars[keta - 1] = top + '0';
            if (dfs(keta - 2, top, otal, chars, K)) {
                return 0;
            }
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:36: error: 'otal' was not declared in this scope; did you mean 'total'?
   48 |             if (dfs(keta - 2, top, otal, chars, K)) {
      |                                    ^~~~
      |                                    total
Language: C++

#include <bits/stdc++.h> 
using namespace std;
using ll = long long;
template<typename T> using v2 = vector<vector<T>>;
template<typename T> inline v2<T> fill(int r, int c, const T& t){ return v2<T>(r, vector<T>(c, t)); }
#define F first
#define S second

void solve(){
    int k;
    cin >> k;

    queue<string> q;
    for(char c = '1'; c <= '9'; ++c) q.push(string(1, c));

    while(true){
        string cur = q.front();
        q.pop();
        if(cur.back() != '0') q.push(cur + char(cur.back()-1));
        q.push(cur + cur.back());
        if(cur.back() != '9') q.push(cur + char(cur.back()+1));
        --k;
        if(!ks){
            cout << cur << '\n';
            return;
        }
    }
    assert(false);
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:23:13: error: 'ks' was not declared in this scope; did you mean 'k'?
   23 |         if(!ks){
      |             ^~
      |             k
Language: C

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

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
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:
main.c:1:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before '::' token
    1 | std::queue<LL> q;
      |    ^~
main.c: In function 'main':
main.c:5:37: error: 'q' undeclared (first use in this function)
    5 |     for (int i = 1; i <= 9; ++i)    q.push(i);
      |                                     ^
main.c:5:37: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:5: error: implicit declaration of function 'read' [-Wimplicit-function-declaration]
    6 |     read(k);
      |     ^~~~
main.c:8:9: error: unknown type name 'LL'
    8 |         LL a = q.front();
      |         ^~
main.c:15:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   15 |     printf("%lld\n", q.front());
      |     ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | std::queue<LL> q;
main.c:15:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   15 |     printf("%lld\n", q.front());
      |     ^~~~~~
main.c:15:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include <iostream>
#include <vector>
using namespace std;
vector<long long int> v;
void dfs(long long n, int k) {
    if(k==11) return;
    v.push_back(n);
    long long a = n%10;
    if(a>=0 && 9>a)  dfs(n*10+a+1,k+1);
    if(a>=0 && 9>=a) dfs(n*10+a,k+1);
    if(a>0 && 9>=a)  dfs(n*10+a-1,k+1);
    return;
}
int main() {
    long long int n;
    cin >> n;
    for(int i=1;i<10;i++) dfs(i,1);
    sort(v.begin(),v.end());
    cout << v[n-1] << endl;
}

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

#include<stdio.h>

int main(){
  int n,i,max;
  int a[5];
  scanf("%d",&n);
  
  if(n<=10)
    printf("%d",n);
  else if(n>10&&n<100000){
    for(i=10;i<n;i++){
      i%10=a[0];
      (i-a[0])%100/10=a[1];
      (i-a[0]-(a[1]*10))%1000/100=a[2];
      (i-a[0]-(a[1]*10)-(a[2]*100))%100000/1000=a[3];
      
      if(a[0]-a[1]>1||a[0]-a[1]<-1)
        break;
      if(a[1]-a[2]>1||a[1]-a[2]<-1)
        break;
      if(a[2]-a[3]>1||a[2]-a[3]<-1)
        break;
      
      max=i;
    }
    printf("%d",max);
  }
  
  else if(n=100000)
    printf("100000");
  
  return 0;
}
    
      
    
  

Compiler output:
main.c: In function 'main':
main.c:12:11: error: lvalue required as left operand of assignment
   12 |       i%10=a[0];
      |           ^
main.c:13:22: error: lvalue required as left operand of assignment
   13 |       (i-a[0])%100/10=a[1];
      |                      ^
main.c:14:34: error: lvalue required as left operand of assignment
   14 |       (i-a[0]-(a[1]*10))%1000/100=a[2];
      |                                  ^
main.c:15:48: error: lvalue required as left operand of assignment
   15 |       (i-a[0]-(a[1]*10)-(a[2]*100))%100000/1000=a[3];
      |                                                ^
Language: C

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

/* キューに入るデータの上限 */
#define MAX_QUEUE_NUM 100000

/* キュー構造体 */
typedef struct QUEUE {
  /* エンキューされているデータの数 */
  int num;
  /* エンキューされているデータ */
  int data[MAX_QUEUE_NUM];
} QUEUE_T;

void initQueue(QUEUE_T*);
void printQueue(QUEUE_T*);
void enqueue(QUEUE_T*, int);
int deqeueue(QUEUE_T*);

/* キューを初期化する関数 */
void initQueue(QUEUE_T *queue){
  int i = 0;
  queue->num = 0;
  for(i = 0; i < MAX_QUEUE_NUM; i++){
    queue->data[i] = 0;
  }
}
/* エンキューする関数 */
void enqueue(QUEUE_T *queue, int input){

  /* キューが満杯なら何もせず関数終了 */
  if(queue->num >= MAX_QUEUE_NUM){
    printf("キューが満杯でエンキューできません\n");
    return;
  }

  /* データをキューの最後に追加 */
  queue->data[queue->num] = input;

  /* データの数もカウントアップ */
  queue->num++;
}
/* デキューする関数 */
int dequeue(QUEUE_T *queue){
  int i = 0;
  int ret = 0;

  /* キューが空なら何もせずに関数終了 */
  if(queue->num == 0){
    printf("キューが空です\n");
    return -1;
  }

  /* デキューした数を取得 */
  ret = queue->data[0];

  /* キューのデータを一つずつ先頭側に移動 */
  for(i = 0; i < queue->num-1; i++){
    queue->data[i] = queue->data[i+1];
  }

  /* キューの最後のデータは不要になるので0で初期化 */
  queue->data[queue->num-1] = 0;

  /* デキューしたのでキューのデータの数を１つ減らす */
  queue->num--;

  return ret;
}
int main(void){

  int m,i;
  int input;
  int output;
  QUEUE_T queue;

  /* キューを初期化 */
  initQueue(&queue);

  for(i=0;i<k;i++){
    output = dequeue(&queue);
    if(output%10 != 0)
      enqueue(&queue, 10*output+(output%10)-1);
    enqueue(&queue, 10*output+(output%10));
    if(output%10 != 9)
      enqueue(&queue, 10*output+(output%10)+1);
  }
  printf("%d",output);
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:81:13: error: 'k' undeclared (first use in this function)
   81 |   for(i=0;i<k;i++){
      |             ^
main.c:81:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")

using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(int i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) (cout << (x) << endl)
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
#define fs first
#define sc second
// 多倍長
#include <boost/rational.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using boost::rational;
using boost::multiprecision::cpp_int;

const int INF = 1e9;
const ll LLINF = 1e16;
const ll MOD = 1e9+7;
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}
 
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
 

// 指定した文字cが文字列に何文字入ってるか
ll stringcount(string s, char c) {
    return count(s.cbegin(), s.cend(), c);
}


// 割り算の切り上げ処理
template<typename T>
T rp(T a, T b) {
  return (a + b - 1) / b;
}

// 桁和
template<typename T>
T digsum(T n) {
    T res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

// 回文判定
bool kai (string s) {
    string t{s};
    reverse(begin(t), end(t));
    return s == t;
}

using pint = pair<int, int>;
using pll = pair<ll, ll>;


int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    ll k;
    cin >> k;
    queue<ll> q;
    REP(i, 1, 10) q.push(i);
    ll count = 0;
    while(!q.empty()){
        ll num = q.front();
        count++;
        if(count == k){
            print(num);
            return 0;
        }
        q.pop();
        ll rem = num % 10;
        if(rem - 1 >= 0) q.push(num * 10 + rem - 1);
        q.push(num * 10 + rem);
        if(rem + 1 <= 9) q.push(num * 10 + rem + 1);
    }




}

\

Compiler output:
a.cc:20:10: fatal error: boost/rational.hpp: No such file or directory
   20 | #include <boost/rational.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
  int k;
  cin >>k;
  vector <int> r;
  
    for(ll i=1;i<=3234566667;i++){
    int a=i%10;
    int b=(i / 10) %10;
    int c=(i / 100) % 10;
    int d=(i /1000) % 10;
    int e=(i /10000) % 10;
    int f=(i /100000) % 10;
    int g=(i /1000000) % 10;
	int h=(i /10000000) % 10;
    int j=(i /100000000) % 10;
    int l=(i /1000000000) % 10;
      if(abs(a-b) >=2 ||abs(c-b) >=2 ||abs(d-c) >=2 ||abs(d-e) >=2 ||
         abs(e-f) >=2 ||abs(f-g) >=2 ||abs(g-h) >=2 ||abs(h-j) >=2 ||
         abs(j-l) >=2 || ) continue;
    if(abs(a-b) <=1 && abs(c-b) <=1 && abs(c-d) <=1 && abs(d-e) <=1 &&
       abs(e-f) <=1 && abs(f-g) <=1 &&abs(h-g) <=1 &&abs(h-j) <=1 
       &&abs(j-l) <=1){
    r.push_back(i);
   
    }
      
    }
cout << r.at(k-1) <<endl;
  
  
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:23:26: error: expected primary-expression before ')' token
   23 |          abs(j-l) >=2 || ) continue;
      |                          ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

// int main()
// {
//     vector<vector<vector<ll>>> Lun(12, vector<vector<ll>>(10, vector<ll>(0)));

//     int K;
//     cin >> K;

//     vector<ll> nums(0);

//     for (int i = 0; i < 10; i++)
//     {

//         Lun[0][i].push_back(i);

//         if (i != 0)
//         {
//             nums.push_back(i);
//         }
//     }

//     for (int i = 1; i < 12; i++)
//     {

//         for (int j = 0; j < 10; j++)
//         {

//             if (j > 0)
//             {

//                 for (int k = 0; k < Lun[i - 1][j - 1].size(); k++)
//                 {

//                     ll A = j * pow(10, i) + Lun[i - 1][j - 1][k];

//                     Lun[i][j].push_back(A);

//                     nums.push_back(A);
//                 }
//             }

//             for (int k = 0; k < Lun[i - 1][j].size(); k++)
//             {

//                 ll A = j * pow(10, i) + Lun[i - 1][j][k];

//                 Lun[i][j].push_back(A);

//                 if (j != 0)
//                 {

//                     nums.push_back(A);
//                 }
//             }

//             if (j < 9)
//             {

//                 for (int k = 0; k < Lun[i - 1][j + 1].size(); k++)
//                 {

//                     ll A = j * pow(10, i) + Lun[i - 1][j + 1][k];

//                     Lun[i][j].push_back(A);

//                     if (j != 0)
//                     {
//                         nums.push_back(A);
//                     }
//                 }
//             }
//         }
//     }

//     sort(nums.begin(),nums.end());

//     cout << nums[K-1] << endl;

//     return 0;
// }

int main()
{

    int K;
    cin >> K;

    queue<ll> A;


    for(int i=1; i<10;i++){

        A.push(i);
    }

    int count = 9;
    while (count < K)
    {
        ll a = A.front();

        A.pop();

        if (a % 10 != 0)
        {

            A.push(a * 10 + a % 10 - 1);
            count++;
            if (count == K)
            {

                break;
            }
        }
        A.push(a * 10 + a % 10);

        count++;
        if (count == K)
        {

            break;
        }

        if (a % 10 != 9)
        {

            A.push(a * 10 + a % 10 + 1);

            count++;
            if (count == K)
            {

                break;
            }
        }
    }


    cout << A.back() << endl;

    retunrn 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:144:5: error: 'retunrn' was not declared in this scope
  144 |     retunrn 0;
      |     ^~~~~~~
Language: C++

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

int main(){
  long long N;
  cin>>N;
  long long temp;
  queue<int>Q;
  for(int i=1;i<=9;i++){
    Q.emplace(i);
  }
  for(long long i=1;i<=N;i++){
    temp=Q.front();
    //cout<<temp<<endl;
    if(temp%10 !=0){
      Q.emplace(temp*10+temp%10-1);
    }
    Q.emplace(temp*10+temp%10);
    if(temp%10 !=9){
      Q.emplace(temp*10+temp%10+1);
    }
    Q.pop();
  }
  cout<<setprecison(20)<<temp<<endl;
  return 0;
}

    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'setprecison' was not declared in this scope
   24 |   cout<<setprecison(20)<<temp<<endl;
      |         ^~~~~~~~~~~
Language: C++

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

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 ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
ll factorial(ll n) {
  if (n == 1) {
    return 1;
  }
  ll ans = factorial(n-1);
  return ans*n;
}
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a%b);
}
ll lcm(ll a, ll b) {
  return (a/gcd(a, b))*b;
}
bool is_prime(ll n) {
  for (ll i = 2; i*i <= n; i++) {
    if (n%i == 0) return false;
  }
  return n != 1;
}
ll mod_pow(ll x, ll n, ll mod) {
  if (n == 0) return 1;
  ll res = mod_pow(x*x%mod, n/2, mod);
  if (n & 1) res = res * x % mod;
  return res;
}

int main() {
  ll k;
  if (k < 10) cout << k << endl;
  else {
    queue <ll> q;
    rep(i, 9) q.push(i+1);
    ll count = 9;
    ll res1, res2, res3;
    while (count < k) {
      ll num = q.top(); q.pop();
      if (num%10 == 0) {
        q.push(num*10); q.push(num*10+1)
        res2 = num*10, res3 = num*10+1;
        num += 2;
      } else if (num%10 == 9) {
        q.push(num*10+8); q.push(num*10+9);
        res2 = num*10+8, res3 = num*10+9;
        num += 2;
      } else {
        for (ll i = -1; i <= 1; i++) {
          q.push(num*10 + num%10 + i);
          if (i < 0) res1 = num*10 + num%10 + i;
          if (i == 0) res2 = num*10 + num%10 + i;
          if (i > 0) res3 = num*10 + num%10 + i;
        }
      }
    }
    if (count == k) cout << res3 << endl;
    else if (count+1 == k) cout << res2 << endl;
    else cout << res1 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:18: error: 'class std::queue<long long int>' has no member named 'top'; did you mean 'pop'?
   64 |       ll num = q.top(); q.pop();
      |                  ^~~
      |                  pop
a.cc:66:41: error: expected ';' before 'res2'
   66 |         q.push(num*10); q.push(num*10+1)
      |                                         ^
      |                                         ;
   67 |         res2 = num*10, res3 = num*10+1;
      |         ~~~~
Language: C++

#include <bits/stdc++.h>
//#define fisier 1
using namespace std;
typedef long long ll;
const double dancila = 3.14159265359;
const int MOD = 1e9 + 7;
bool lunlun(unsigned long long n){
	if (n < 10)
		return true;
	while (n){
		if (abs(n%10-n/10%10) > 1)
			return false;
		n/=100;
	}
	return true;
}
int main(){
	#ifdef fisier
        ifstream cin("input.in");
        ofstream cout("output.out");
    #endif	
		
	ios_base::sync_with_stdio();
	cin.tie(0);
	
	unsigned long long k, cnt = 0;
	cin >> k;
	for (unsigned long long i = 1; i <= 1e5; ++i){
		if (lunlun(i)) cnt++;
		if (cnt == k){
			cout << i;
			return 0;
		}
	}
}


Compiler output:
a.cc: In function 'bool lunlun(long long unsigned int)':
a.cc:11:24: error: call of overloaded 'abs(long long unsigned int)' is ambiguous
   11 |                 if (abs(n%10-n/10%10) > 1)
      |                     ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
  137 |   abs(__float128 __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
   85 |   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
Language: C++

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

int main(){
    int k;
    cin >> k;
    queue<ll> a;
    for(int i = 1;i<10;i++){
        a.push(i);
    }
    rep(i,k-1){
        ll s = a.front();
        a.pop();
        for(int j = -1;i <= 1;j++){
            ll add = (s%10) + j;
            if(add >= 0 && add <= 9) que.push(s * 10 + add);
        }
    }
    cout << que.front() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:38: error: 'que' was not declared in this scope
   19 |             if(add >= 0 && add <= 9) que.push(s * 10 + add);
      |                                      ^~~
a.cc:22:13: error: 'que' was not declared in this scope
   22 |     cout << que.front() << endl;
      |             ^~~
Language: C++

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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

set<long long> v;

void dfs(int i, long long prev=0) {
  if (prev > 3234566667) {
    return;
  }
  if (prev) v.insert(prev);
  if (i-1 >= 0) dfs(i-1, prev*10+(i-1));
  dfs(i, prev*10+i);
  if (i+1 < 10) dfs(i+1, prev*10+(i+1))
}

void solve() {
  int k; scanf("%d", &k);
  for (int i = 0; i < 10; ++i) {
    dfs(i);
  }
  for (auto e: v) {
    if (!k--) {
      printf("%lld", e);
    }
  }
}

int main() {
  init();
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


Compiler output:
a.cc: In function 'void dfs(int, long long int)':
a.cc:24:40: error: expected ';' before '}' token
   24 |   if (i+1 < 10) dfs(i+1, prev*10+(i+1))
      |                                        ^
      |                                        ;
   25 | }
      | ~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
using namespace std;
#include <math.h>
#include <vector>
#include <queue>

int main() {

	int k;

	queue<int> que;

	cin >> k;

	que.push(1);
	que.push(2);
	que.push(3);
	que.push(4);
	que.push(5);
	que.push(6);
	que.push(7);
	que.push(8);
	que.push(9);

	int x;

	for (int i = 0; i < k; i++) {
		x = que.fromt();
		if (x % 10 != 0) {
			que.push(10 * x + x % 10 - 1);
		}
		que.push(10 * x + x % 10);
		if (x % 10 != 9) {
			que.push(10 * x + x % 10 + 1);
		}
		que.pop();
	}

	cout << x;

	cin >> x;

	return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:25: error: 'class std::queue<int>' has no member named 'fromt'; did you mean 'front'?
   31 |                 x = que.fromt();
      |                         ^~~~~
      |                         front
Language: C++

#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#define rep(i,n) for (long long i=0; i < (n); ++i)
#define rep2(i,n,m) for(long long i=n;i<=m;i++)
#define ALL(a)  (a).begin(),(a).end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
int main() {
  ll n ;
  cin >> n;
  queue<ll> A ; rep2(i,1,9) A.push(i) ;
  ll kai=0 ;
  ll ans= 0;
  while(kai<=n){
    ll base= A.front() ;//先頭の値の取得の時にカウント
     ans=base ;       //先にあんすを保存
    kai ++ ;            //操作回数に関わらずキューの順で取得
    if(base%10!=0) A.push(base*10+(base%10)-1) ;
    A.push(base*10+(base%10)) ;
    if(base%10!=9) A.push(base*10+(base%10)+1) ;
　　A.pop() ;            //操作は一回きりなので用済みを先頭から削除
  }
    cout << ans<< endl ; 
     return 0;
}

Compiler output:
a.cc:27:1: error: extended character 　 is not valid in an identifier
   27 | 　　A.pop() ;            //操作は一回きりなので用済みを先頭から削除
      | ^
a.cc:27:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:27:1: error: '\U00003000\U00003000A' was not declared in this scope
   27 | 　　A.pop() ;            //操作は一回きりなので用済みを先頭から削除
      | ^~~~~
Language: C++

#include<bits/stdc++.h>
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(long long i=1; i<10; i++){rec(1,i,all)}
  sort(all.begin(),all.end());
  cout<<all[K-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:47: error: expected ';' before '}' token
   19 |     for(long long i=1; i<10; i++){rec(1,i,all)}
      |                                               ^
      |                                               ;
Language: C++

#include<bits/stdc++.h>
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(long long i=1; i<10; i++){rec(1,i,all)}
  sort(all.begin(),all.end());
  cout<<all[K-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: expected ';' before 'vector'
   17 |   cin>>K
      |         ^
      |         ;
   18 |     vector<long long>all;
      |     ~~~~~~
a.cc:19:43: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   19 |     for(long long i=1; i<10; i++){rec(1,i,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:20:8: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   20 |   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;

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(long long i=1; i<10; i++){rec(1,i,all)}
  sort(all.begin(),all.end());
  cout<<all[K-1]<<endl;
}

Compiler output:
a.cc: In function 'void rec(int, long long int, std::vector<long long int>&)':
a.cc:15:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   15 | int main(){
      |         ^~
a.cc:15:9: note: remove parentheses to default-initialize a variable
   15 | int main(){
      |         ^~
      |         --
a.cc:15:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:15:11: error: a function-definition is not allowed here before '{' token
   15 | int main(){
      |           ^
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:4:53: note: to match this '{'
    4 | void rec(int d,long long val, vector<long long>&all){
      |                                                     ^
Language: C++

#include<bits/stdc++.h>
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(long long i=1; i<10; i++){rec(1,i,all)}
  sort(all.begin(),all.end());
  cout<<all[K-1]<<endl;
}

Compiler output:
a.cc:4:29: error: expected ')' before ';' token
    4 | void rec(int d,long long val; vector<long long>&all){
      |         ~                   ^
      |                             )
a.cc:4:52: error: expected initializer before ')' token
    4 | void rec(int d,long long val; vector<long long>&all){
      |                                                    ^
Language: C++

#include <stdio.h>
typedef long long ll;
ll dp[100001][10];
inline bool chk(int x){
	return 0<=x&&x<10;
}
void sol(int i, int j, int K){
	printf("%d",j);
	if(i==1) return;
	for(int l=-1;l<=1;l++){
		if(chk(j+l)){
			if(K>=dp[i-1][j+l]) return sol(i-1,j+l,K);
			else K-=dp[i-1][j+l];
		}
	}
}
int main(){
	int K;scanf("%d",&K);
	for(int i=0;i<10;i++) dp[1][i]=1;
	for(int i=2;i<=K;i++){
		for(int j=0;j<10;j++){
			for(int l=-1;l<=1;l++){
				if(chk(j+l)) dp[i][j] += dp[i-1][j+l];
			}
			if(j==0) continue;
			if(K<=dp[i][j]){
				sol(i,j,k);
				return 0;
			}
			else K-=dp[i][j];
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:41: error: 'k' was not declared in this scope
   27 |                                 sol(i,j,k);
      |                                         ^
Language: C++

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


void dfs(int digit,long sum,vector<long> &A)
{
  A.push_back(sum);
  if(d==10)
    return;
  
  for(int j=-1;j<=1;j++)
  {
    int number_add=sum%10+j;
    if(number_add>=0&&number_add<=9)
      dfs(d+1,sum*10+number_add,A);
  }
}

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

Compiler output:
a.cc: In function 'void dfs(int, long int, std::vector<long int>&)':
a.cc:8:6: error: 'd' was not declared in this scope
    8 |   if(d==10)
      |      ^
a.cc:15:11: error: 'd' was not declared in this scope
   15 |       dfs(d+1,sum*10+number_add,A);
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
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; }
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll INF = 1LL<<60;
const ll MOD = 1e9 + 7;


int N;
int cnt;
int K;
vector<vector<int>> veclist;
void func(vector<int> &A,N) {
    // 数列の長さが N に達したら打ち切り
    if (A.size() == N) {
        veclist.push_back(A);
        return;
    }
    //Mパターン次の数字が考えられる
    for (int v = -1; v <= 1; ++v) {    //絶対値の差が⁺⁻1
        int end = A.at(A.size() - 1);
        if (end + v >= 0 && end + v <= 9) {
            A.push_back(end + v);  //次の数字を足す
            func(A,N);         //その新しいパターン
            A.pop_back();    //消して、もう一回新たな数字を足す工程へ
        }        
    }
}

int main() {
    vector<vector<int>> veclist;
    for (int  i = 0;i <= 10;i++) {
        vector<int> A;
        func(A,N);
    }
    int K;
    cin >> K;
    vector<int> ans;
    ans = veclist.at(K);
    for (int i = 0;i<ans.size();i++) {
        cout << ans.at(i);
    }
}












Compiler output:
a.cc:16:26: error: 'N' is not a type
   16 | void func(vector<int> &A,N) {
      |                          ^
Language: C++

#include <bits/stdc++.h>
int main()
{
	int k;
	cin>>k;
	  queue <int> q;
	for(int i = 1; i < 10; i++)
	 	q.push(i);

	 int ans;

	for(int i = 0; i<k; i++)
	{
		x = q.pop;
		if(i = k-1){x=ans;}
		if(x%10!=0){q.push(x*10+x%10-1);}
		q.push(x*10+x%10);
		if(x%10!=0){q.push(x*10+x%10+1);}
		
	}
  cout<<ans;
	 return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |         cin>>k;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:11: error: 'queue' was not declared in this scope; did you mean 'std::queue'?
    6 |           queue <int> q;
      |           ^~~~~
      |           std::queue
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157:
/usr/include/c++/14/bits/stl_queue.h:96:11: note: 'std::queue' declared here
   96 |     class queue
      |           ^~~~~
a.cc:6:18: error: expected primary-expression before 'int'
    6 |           queue <int> q;
      |                  ^~~
a.cc:8:17: error: 'q' was not declared in this scope
    8 |                 q.push(i);
      |                 ^
a.cc:14:17: error: 'x' was not declared in this scope
   14 |                 x = q.pop;
      |                 ^
a.cc:14:21: error: 'q' was not declared in this scope
   14 |                 x = q.pop;
      |                     ^
a.cc:21:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   21 |   cout<<ans;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

class Solution {
public:
	void solve() {
		int n;
		cin >> n;
		vector<vector<int>> dp(10, vector<int>(10, 0)), dp2(10, vector<int>(10, 0));
		for (int i = 0; i < 10; i++) dp[0][i] = 1;
		for (int i = 1; i < 10; i++) {
			for (int j = 0; j < 10; j++) {
				for (int k = max(j - 1, 0); k <= min(j + 1, 9); k++) {
					dp[i][j] += dp[i - 1][k];
				}
				dp2[i][j] = dp[i][j]; 
			}
		}
		dp2[0][0] = 0;
		for (int i = 0; i < 10; i++) {
			if (i != 0) dp2[i][0] = dp2[i - 1][9];
			for (int j = 1; j < 10; j++) dp2[i][j] += dp2[i][j - 1];
		}
		long long ans = 0, d = 1;
		int x = 0, y;
		for(int i = 0; i < 10; i++, d*=10){
			for(int j = 1; j < 10; j++){
				if(dp2[i][j] > n){
					if(j - 1){
						ans = 9 * (d/10);
						x = i-1;
						y = 9;
					}
					else{
						ans = (j-1) * d;
						x = i;
						y = j-1;
						break;
					}
				}
			}
		}
		
		long long d = 1000000000;

		return;
	};
};

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	Solution solution;
	solution.solve();
	return 0;
}

Compiler output:
a.cc: In member function 'void Solution::solve()':
a.cc:45:27: error: redeclaration of 'long long int d'
   45 |                 long long d = 1000000000;
      |                           ^
a.cc:25:36: note: 'long long int d' previously declared here
   25 |                 long long ans = 0, d = 1;
      |                                    ^
Language: C

#include <stdio.h>

int x[110],res[110];
int a;
void solve(int k, int value, int& sum){
	 x[k] = value;
	if(k==1){
		sum++;
		if(sum==a)
            for(int i=1;i<=10;i++)
                 res[i] = x[i];
		return;
	}

	if(value>=1) solve(k-1,value-1,sum);

	solve(k-1,value,sum);

	if(value<=8) solve(k-1,value+1,sum);

}
int main(){
	scanf("%d",&a);

	int sum = 0;
	for(int i=1;i<=10;i++)
		for(int j=1;j<=9;j++)
			solve(i,j,sum);

	int p = 0;
	for(int i=10;i>=1;i--)
		if(res[i]!=0){
			p = i;
			break;
		}
	for(int i=p;i>=1;i--)
          printf("%d",res[i]);
}


Compiler output:
main.c:5:33: error: expected ';', ',' or ')' before '&' token
    5 | void solve(int k, int value, int& sum){
      |                                 ^
main.c: In function 'main':
main.c:28:25: error: implicit declaration of function 'solve' [-Wimplicit-function-declaration]
   28 |                         solve(i,j,sum);
      |                         ^~~~~
Language: C

#include <stdio.h>

int x[110],res[110];
int a;
void solve(int k, int value, int& sum){
	 x[k] = value;
	if(k==1){
		sum++;
		if(sum==a) 
            for(int i=1;i<=10;i++) 
                res[i] = x[i];
		return;
	}
	
	if(value>=1) solve(k-1,value-1,sum);
	
	solve(k-1,value,sum);
	
	if(value<=8) solve(k-1,value+1,sum);
	
}
int main(){
	scanf("%d",&a);
	
	int sum = 0;
	for(int i=1;i<=10;i++)
		for(int j=1;j<=9;j++)
			solve(i,j,sum);
    
	int p = 0;
	for(int i=10;i>=1;i--)
		if(res[i]!=0){
			p = i;
			break;
		}
	for(int i=p; i>=1;i--)
          printf("%d",res[i]);
}


Compiler output:
main.c:5:33: error: expected ';', ',' or ')' before '&' token
    5 | void solve(int k, int value, int& sum){
      |                                 ^
main.c: In function 'main':
main.c:28:25: error: implicit declaration of function 'solve' [-Wimplicit-function-declaration]
   28 |                         solve(i,j,sum);
      |                         ^~~~~
Language: C++

#include <cstring>
#include <iostream>
#include <numeric>
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,b;
  cin>>N;
  long long counter=0;
  queue<long long>a;
  for(int i=0;i<9;i++){
  a.push(i+1);}
  for(int i=1;i<=N;i++){
  if(i==N){
  cout<<a.front()<<endl;
  break;
  }
  else{
  b=a.front();
  if(b%10!=0){
  a.push(10*b+b%10-1);}
  a.push(10*b+b%10);
  if(b%10!=9){
  a.push(10*b+b%10+1);}

  }}


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

#include <cstring>
#include <iostream>
#include <numeric>
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,b;
  cin>>N;
  long long counter=0;
  queue<long long>a;
  for(int i=0;i<9;i++){
  a.push(i+1);}
  for(int i=1;i<=N;i++){
  if(i==N){
  cout<<a.front()<<endl;
  break;
  }
  else{
  b=a.front();
  if(b%10!=0){
  a.push(10*b+b%10-1)}
  a.push(10*b+b%10);
  if(b%10!=9){
  a.push(10*b+b%10+1)}

  }}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:22: error: expected ';' before '}' token
   21 |   a.push(10*b+b%10-1)}
      |                      ^
      |                      ;
a.cc:24:22: error: expected ';' before '}' token
   24 |   a.push(10*b+b%10+1)}
      |                      ^
      |                      ;
a.cc:26:5: error: expected '}' at end of input
   26 |   }}
      |     ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include <cstring>
#include <iostream>
#include <numeric>
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,b;
  cin>>N;
  long long counter=0;
  queue<long long>a;
  for(int i=0;i<9;i++){
  a.push(i+1);}
  for(int i=1;i<=N;i++){
  if(i==N){
  cout<<a.front()<<endl;
  break;
  }
  else{
  b=a.front();
  if(b%10!=0){
  a.push(10*b+b%10-1);}
  a.push(10*b+b%10);
  if(b%10!=9){
  a.push(10*b+b%10+1);}

  }


Compiler output:
a.cc: In function 'int main()':
a.cc:26:4: error: expected '}' at end of input
   26 |   }
      |    ^
a.cc:13:24: note: to match this '{'
   13 |   for(int i=1;i<=N;i++){
      |                        ^
a.cc:26:4: error: expected '}' at end of input
   26 |   }
      |    ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include <cstring>
#include <iostream>
#include <numeric>
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,b;
  cin>>N;
  long long counter=0;
  queue<long long>a;
  for(int i=0;i<9;i++){
  a.push(i+1);}
  for(int i=1;i<=N;i++){
  if(i==N){
  cout<<a.front()<<endl;
  break;
  }
  else{
  b=a.front();
  if(b%10!=0){
  a.push(10*b+b%10-1)}
  a.push(10*b+b%10);
  if(b%10!=9){
  a.push(10*b+b%10+1)}

  }


Compiler output:
a.cc: In function 'int main()':
a.cc:21:22: error: expected ';' before '}' token
   21 |   a.push(10*b+b%10-1)}
      |                      ^
      |                      ;
a.cc:24:22: error: expected ';' before '}' token
   24 |   a.push(10*b+b%10+1)}
      |                      ^
      |                      ;
a.cc:26:4: error: expected '}' at end of input
   26 |   }
      |    ^
a.cc:13:24: note: to match this '{'
   13 |   for(int i=1;i<=N;i++){
      |                        ^
a.cc:26:4: error: expected '}' at end of input
   26 |   }
      |    ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
vector<ll> v;
void dfs(ll a,int b){
 	v.push_back(a);
  	if(b>8)
      	return ;
  	int s = a%10;
  	dfs(a*10+s,b+1);
  	if(s!=0)
      dfs(a*10 + s - 1,b+1);
  	if(s <= 8)
      	dfs(a*10 + s + 1,b+1);
}
int main(){
 	int k;
  	cin>>k;
  	for(i=1;i<=9;++i)
      	dfs(i,0);
  	sort(v.begin(),v.end());
  	erase(unique(v.begin(),v.end()),v.end());
  	cout<<v[k-1]<<"\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'i' was not declared in this scope
   19 |         for(i=1;i<=9;++i)
      |             ^
a.cc:22:9: error: 'erase' was not declared in this scope
   22 |         erase(unique(v.begin(),v.end()),v.end());
      |         ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
set<ll> v;
void dfs(ll a,int b){
 	v.insert(a);
  	if(b>8)
      	return ;
  	int s = a%10;
  	dfs(a*10+s,b+1);
  	if(s!=0)
      dfs(a*10 + s - 1,b+1);
  	if(s <= 8)
      	dfs(a*10 + s + 1,b+1);
}
int main(){
 	int k;
  	cin>>k;
  	for(i=1;i<=9;++i)
      	dfs(i,0);
  	cout<<v[k-1]<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'i' was not declared in this scope
   19 |         for(i=1;i<=9;++i)
      |             ^
a.cc:21:16: error: no match for 'operator[]' (operand types are 'std::set<long long int>' and 'int')
   21 |         cout<<v[k-1]<<"\n";
      |                ^
Language: C++

k=int(input())
a=[]
for i in range(1,10):
    a.append(i)
for i in range(k):
    x=a[i]
    if x%10!=0:
        a.append(x*10+x%10-1)
    a.append(x*10+x%10)
    if x%10!=9:
        a.append(x*10+x%10+1)
mod=10**9+7
print(x%mod)

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

#include<stdio.h>
#include<stdlib>
#defineK_MAX 100000
#define -1 1

int main(){
};
  /*int k,num=0;
  long long n=1,l=1;
  scanf("%d",&k);
  while(k>num){
    l=n
    while(l>=10){
      if(l%10!=l/10%10)break;
      l/=10;
    };
    if(l==0)*/
    

Compiler output:
main.c:2:9: fatal error: stdlib: No such file or directory
    2 | #include<stdlib>
      |         ^~~~~~~~
compilation terminated.
Language: C++

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric>
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;



int main() {
	int k;
	cin >> k;
	vector<ll> a;
	for (int i = 1; i <= 9; ++i) a.push_back(i);
	while (true) {
		if (k <= a.size()) {
			cout << k[k - 1] << endl;
			return 0;
		}
		k -= a.size();
		vector<ll> old;
		swap(old, a);
		for (long long x : old) { //oldの初めから終わりまでの数でループ
			for (int i = -1; i <= 1; i++) {
				int d = x * 10 + i;//dは桁
				if (d < 0 || d>9) continue;
				ll nx = x * 10 + d;
				a.push_back(nx);
			}
		}
	}
		return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:34: error: invalid types 'int[int]' for array subscript
   19 |                         cout << k[k - 1] << endl;
      |                                  ^
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<=0){
	    cout<<a[i];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:6:1: error: expected initializer before 'int'
    6 | int main(){
      | ^~~