Submission #976006

#TimeUsernameProblemLanguageResultExecution timeMemory
976006OrifkhonPermutation (APIO22_perm)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "perm.h" using namespace std; #ifdef LOCAL #include "debug.cpp" #else #define debug(...) #endif #define ll long long vector<int> construct_permutation(long long k) { ll size = 63 - __builtinll_clz(k); vector<int> perm(size); for(int i = 0; i < size; i++){ perm[i] = i; } k-=(1ll << size); ll insert = size; while(k > 0){ ll ind = 63 - __builtinll_clz(k); k-=(1ll << ind); perm.insert(perm.begin() + ind, insert); insert++; } debug(perm); return perm; }

Compilation message (stderr)

perm.cpp: In function 'std::vector<int> construct_permutation(long long int)':
perm.cpp:14:20: error: '__builtinll_clz' was not declared in this scope; did you mean '__builtin_clz'?
   14 |     ll size = 63 - __builtinll_clz(k);
      |                    ^~~~~~~~~~~~~~~
      |                    __builtin_clz