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;
#define ar array
#define sz(v) int(v.size())
typedef long long ll;
vector<int> construct_permutation(long long k) {
int l = 63 - __builtin_clzll(k);
int m = 0;
deque<int> ans;
for (int i = l-1; i >= 0; i--) {
ans.push_back(m++);
if ((k >> i) & 1) ans.push_front(m++);
}
return vector<int>(ans.begin(), ans.end());
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |