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;
std::vector<int> construct_permutation(long long k){
vector< int > arr;
k--;
for(long long i = 61;i > 0;i--){
while((1LL << i) - 1 <= k){
k -= (1LL << i) - 1;
for(int j = 0 ;j < i;j++){
arr.push_back((int)arr.size() - j + (i - j - 1));
}
}
}
reverse(arr.begin(),arr.end());
return arr;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |