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"
#include <bits/stdc++.h>
using namespace std;
vector<int> construct_permutation(long long k) {
int b = 63 - __builtin_clzll(k);
k -= 1LL << b;
int c = __builtin_popcountll(k);
vector<int> key(b);
iota(key.begin(), key.end(), c);
for (int i = 0; i < c; i++) {
int a = 63 - __builtin_clzll(k & -k);
k -= 1LL << a;
key.insert(key.begin() + b - a, i);
}
return key;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |