Language: C++

#include<cstdio>
#include<cmath>

using namespace std;

long long N;

long long s (long long x){
  long long i = x;
  long long c=0;
  for(long long n=1;x>=n;n*=3){
    long long a = i%3;
    prlong longf("%d\n",a);
    i /= 3;
    if(a == 1)
      c += n*2;
    if(a == 2)
      c += n;
  }
  return c;
}
long long r (long long x){
  return (x+1) % N;
}

long long pow3(int n){
  if(n == 1)
    return 3;
  long long r = pow(n/2);
  if(n%2 == 1)
    return r*r*3;
  return r*r;    

}

int main(){
  long long n;
  scanf("%d",&n);
  N = pow(n);
  char danse[200000];
  scanf("%s",danse);
  for(int i=0;i<N;i++){
    if(i != 0)
      printf(" ");
    int res = i;
    for(char d: danse){
      if(d == 'S'){
        res = s(res);
      }else if(d == 'R'){
        res = r(res);
      }else{
        break;
      }
    }
    printf("%d", res);
  }
}


Compiler output:
a.cc: In function 'long long int s(long long int)':
a.cc:13:5: error: 'prlong' was not declared in this scope; did you mean 'ulong'?
   13 |     prlong longf("%d\n",a);
      |     ^~~~~~
      |     ulong
a.cc: In function 'long long int pow3(int)':
a.cc:29:20: error: no matching function for call to 'pow(int)'
   29 |   long long r = pow(n/2);
      |                 ~~~^~~~~
In file included from a.cc:2:
/usr/include/c++/14/cmath:1074:5: note: candidate: 'template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::pow(_Tp, _Up)'
 1074 |     pow(_Tp __x, _Up __y)
      |     ^~~
/usr/include/c++/14/cmath:1074:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cstdio:41,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: candidate: 'double pow(double, double)'
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:380:3: note: candidate: 'constexpr long double std::pow(long double, long double)'
  380 |   pow(long double __x, long double __y)
      |   ^~~
/usr/include/c++/14/cmath:380:3: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:376:3: note: candidate: 'constexpr float std::pow(float, float)'
  376 |   pow(float __x, float __y)
      |   ^~~
/usr/include/c++/14/cmath:376:3: note:   candidate expects 2 arguments, 1 provided
a.cc: In function 'int main()':
a.cc:39:10: error: no matching function for call to 'pow(long long int&)'
   39 |   N = pow(n);
      |       ~~~^~~
/usr/include/c++/14/cmath:1074:5: note: candidate: 'template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::pow(_Tp, _Up)'
 1074 |     pow(_Tp __x, _Up __y)
      |     ^~~
/usr/include/c++/14/cmath:1074:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: candidate: 'double pow(double, double)'
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:380:3: note: candidate: 'constexpr long double std::pow(long double, long double)'
  380 |   pow(long double __x, long double __y)
      |   ^~~
/usr/include/c++/14/cmath:380:3: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:376:3: note: candidate: 'constexpr float std::pow(float, float)'
  376 |   pow(float __x, float __y)
      |   ^~~
/usr/include/c++/14/cmath:376:3: note:   candidate expects 2 arguments, 1 provided