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<iostream>
#include<vector>
#include<algorithm>
#include "perm.h"
using namespace std;
std::vector<int> construct_permutation(long long k)
{
vector<int> sol;
int cnt=0;
k--;
for(int i=59;i>0;i--)
{
while(k>=(1LL<<i)-1)
{
for(int j=cnt+i-1;j>=cnt;j--)
sol.push_back(j);
cnt += i;
k -= (1LL<<i)-1;
}
}
reverse(sol.begin(),sol.end());
return sol;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |