Language: C++

#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>

int main(){
  int N;
  cin >> N;
  vector<int> A(12);
  A.push_back(1);//9^0 or 6^0
  for(int i = 1; i <=6 ; i++){
    A.push_back(pow(6,i));
  }
  for(int i = 1; i <=5 ; i++){
    A.push_back(pow(9,i));
  }
  
  sort(A.begin() ,A.end() ,greater<int>());
  int tmp = N;
  int cnt = 0;
  for(int i = 0; i < A.size(); i++){
    if(tmp - A[i] < 0) continue;
    tmp -= A[i];
    cnt++;
  }
  cnt += tmp;
  cout << cnt;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   cin >> N;
      |   ^~~
      |   std::cin
In file included 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:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int> A(12);
      |   ^~~~~~
a.cc:9:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> A(12);
      |          ^~~
a.cc:10:3: error: 'A' was not declared in this scope
   10 |   A.push_back(1);//9^0 or 6^0
      |   ^
a.cc:18:28: error: 'greater' was not declared in this scope; did you mean 'std::greater'?
   18 |   sort(A.begin() ,A.end() ,greater<int>());
      |                            ^~~~~~~
      |                            std::greater
In file included from /usr/include/c++/14/string:49,
                 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,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/bits/stl_function.h:353:12: note: 'std::greater' declared here
  353 |     struct greater;
      |            ^~~~~~~
a.cc:18:36: error: expected primary-expression before 'int'
   18 |   sort(A.begin() ,A.end() ,greater<int>());
      |                                    ^~~
a.cc:18:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   18 |   sort(A.begin() ,A.end() ,greater<int>());
      |   ^~~~
      |   std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:4:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:27:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   27 |   cout << cnt;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~