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){
int Max = 0;
int cur = 0;
for(int i = 0; i < 60; i++){
if((((long long)1)<<i)&k){
Max = i;
cur++;
}
}
cur--;
vector<int> ans;
for(int i = 0; i < Max; i++){
if((((long long)1)<<i)&k){
cur--;
ans.push_back(Max+cur);
}
ans.push_back(i);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |