This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "perm.h"
std::vector<signed> construct_permutation(long long k)
{
long long j = 63-__builtin_clzll(k), x = 0;
std::vector<int> v, app;
for(long long i = 0; i < j; i++) {
if(k&(1LL<<i)) app.push_back(x++);
v.push_back(x++);
}
v.insert(v.end(), app.rbegin(), app.rend());
return v;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |