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"
using namespace std;
typedef long long i64;
typedef vector<int> vi;
const int mxLOG = 62;
vi construct_permutation(i64 k) {
vi a;
for(int i = mxLOG - 1; i >= 0; i--) {
if((k & (1LL << i)) != (1LL << i)) continue;
if(a.size() == 0) {
for(int j = 0; j < i; j++)
a.push_back(j);
continue;
}
for(int &x : a)
if(x >= i)
x++;
a.push_back(i);
}
return a;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |