This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// Source: https://usaco.guide/general/io
#include <bits/stdc++.h>
#include <perm.h>
using namespace std;
vector<int> construct_permutation(long long k) {
int z = __lg(k);
vector<int> p(z);
iota(p.begin(), p.end(), 0);
for (int i = z - 1; i >= 0; i--) {
if ((k >> i) & 1) {
p.insert(p.begin() + i, z++);
}
}
return p;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |