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>
#include "perm.h"
#define pb push_back
using namespace std;
vector<int> construct_permutation(long long k){
int g = __lg(k);
vector<int> ans(g);
iota(ans.begin(), ans.end(), 0);
for(int i = g - 1; i >= 0; --i){
if(k & (1LL << i))
ans.insert(ans.begin() + i, g++);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |