Language: C++

#include <bits/stdc++.h>
#define long long __int128
using namespace std;
typedef pair<long long,int> pr;
vector<pr>v;
bool cmp(pr& x,pr& y){
    if(x.first * y.second == y.first * x.second)
        return x.first < y.first;
    return x.first * y.second < y.first * x.second;
}
int K;
int main(){
    cin>>K;
    // #(9)
    v.push_back({0,0});
    for(int i=0;i<16;i++){
        long long digit=1,sum=0;
        for(int j=0;j<i;j++,digit*=10){
            sum+=digit*9;
        }
        for(int j=0;j<10000;j++){
            v.push_back({j*digit+sum,j%10+j/10%10+j/100+9*i});
        }
    }
    sort(v.begin(),v.end(),cmp);
    long long high=0;
    for(auto &p:v){
        if(p.first>high){
            cout<<(__int64)p.first<<' ';
            high=p.first;
            K--;
            if(K==0)return 0;
        }
    }
    return 0;
}


Compiler output:
a.cc:2:19: error: two or more data types in declaration of 'type name'
    2 | #define long long __int128
      |                   ^~~~~~~~
a.cc:4:14: note: in expansion of macro 'long'
    4 | typedef pair<long long,int> pr;
      |              ^~~~
a.cc:4:27: error: template argument 1 is invalid
    4 | typedef pair<long long,int> pr;
      |                           ^
a.cc: In function 'bool cmp(pr&, pr&)':
a.cc:7:10: error: request for member 'first' in 'x', which is of non-class type 'pr' {aka 'int'}
    7 |     if(x.first * y.second == y.first * x.second)
      |          ^~~~~
a.cc:7:20: error: request for member 'second' in 'y', which is of non-class type 'pr' {aka 'int'}
    7 |     if(x.first * y.second == y.first * x.second)
      |                    ^~~~~~
a.cc:7:32: error: request for member 'first' in 'y', which is of non-class type 'pr' {aka 'int'}
    7 |     if(x.first * y.second == y.first * x.second)
      |                                ^~~~~
a.cc:7:42: error: request for member 'second' in 'x', which is of non-class type 'pr' {aka 'int'}
    7 |     if(x.first * y.second == y.first * x.second)
      |                                          ^~~~~~
a.cc:8:18: error: request for member 'first' in 'x', which is of non-class type 'pr' {aka 'int'}
    8 |         return x.first < y.first;
      |                  ^~~~~
a.cc:8:28: error: request for member 'first' in 'y', which is of non-class type 'pr' {aka 'int'}
    8 |         return x.first < y.first;
      |                            ^~~~~
a.cc:9:14: error: request for member 'first' in 'x', which is of non-class type 'pr' {aka 'int'}
    9 |     return x.first * y.second < y.first * x.second;
      |              ^~~~~
a.cc:9:24: error: request for member 'second' in 'y', which is of non-class type 'pr' {aka 'int'}
    9 |     return x.first * y.second < y.first * x.second;
      |                        ^~~~~~
a.cc:9:35: error: request for member 'first' in 'y', which is of non-class type 'pr' {aka 'int'}
    9 |     return x.first * y.second < y.first * x.second;
      |                                   ^~~~~
a.cc:9:45: error: request for member 'second' in 'x', which is of non-class type 'pr' {aka 'int'}
    9 |     return x.first * y.second < y.first * x.second;
      |                                             ^~~~~~
a.cc: In function 'int main()':
a.cc:15:16: error: no matching function for call to 'std::vector<int>::push_back(<brace-enclosed initializer list>)'
   15 |     v.push_back({0,0});
      |     ~~~~~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<int>::value_type&' {aka 'const int&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<int>::value_type&&' {aka 'int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:2:19: error: two or more data types in declaration of 'digit'
    2 | #define long long __int128
      |                   ^~~~~~~~
a.cc:17:9: note: in expansion of macro 'long'
   17 |         long long digit=1,sum=0;
      |         ^~~~
a.cc:2:19: error: two or more data types in declaration of 'sum'
    2 | #define long long __int128
      |                   ^~~~~~~~
a.cc:17:9: note: in expansion of macro 'long'
   17 |         long long digit=1,sum=0;
      |         ^~~~
a.cc:18:29: error: 'digit' was not declared in this scope
   18 |         for(int j=0;j<i;j++,digit*=10){
      |                             ^~~~~
a.cc:19:13: error: 'sum' was not declared in this scope
   19 |             sum+=digit*9;
      |             ^~~
a.cc:22:28: error: 'digit' was not declared in this scope
   22 |             v.push_back({j*digit+sum,j%10+j/10%10+j/100+9*i});
      |                            ^~~~~
a.cc:22:34: error: 'sum' was not declared in this scope
   22 |             v.push_back({j*digit+sum,j%10+j/10%10+j/100+9*i});
      |                                  ^~~
a.cc:22:24: error: no matching function for call to 'std::vector<int>::push_back(<brace-enclosed initializer list>)'
   22 |             v.push_back({j*digit+sum,j%10+j/10%10+j/100+9*i});
      |             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<int>::value_type&' {aka 'const int&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<int>::value_type&&' {aka 'int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:2:19: error: two or more data types in declaration of 'high'
    2 | #define long long __int128
      |                   ^~~~~~~~
a.cc:26:5: note: in expansion of macro 'long'
   26 |     long long high=0;
      |     ^~~~
a.cc:28:14: error: request for member 'first' in 'p', which is of non-class type 'int'
   28 |         if(p.first>high){
      |              ^~~~~
a.cc:28:20: error: 'high' was not declared in this scope
   28 |         if(p.first>high){
      |                    ^~~~
a.cc:29:20: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
   29 |             cout<<(__int64)p.first<<' ';
      |                    ^~~~~~~
      |                    __ynf64
a.cc:30:20: error: request for member 'first' in 'p', which is of non-class type 'int'
   30 |             high=p.first;
      |                    ^~~~~