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 <bits/stdc++.h>
#define ll long long
#define FOR(i,a,b) for(ll i=a;i<b;i++)
using namespace std;
vector<int> construct_permutation(ll k) {
int lbit = __lg(k);
vector<int> ans(lbit);FOR(i,0,lbit)ans[i]=i;
for (int i = lbit - 1; i >= 0; i--) {
if ((k >> i) & 1) {
ans.insert(ans.begin() + i, lbit++);
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |