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<int> construct_permutation(long long k)
{
int j = 63-__builtin_clzll(k), x = 0;
std::vector<int> v, app;
for(int i = 0; i < j; i++) {
if(k&1<<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... |