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 ll long long
std::vector<int> construct_permutation(long long k)
{
if(k == 1)
{
return {};
}
if(k == 2)
{
return {0};
}
vector<int> ret = construct_permutation(k/2);
ret.push_back((int)ret.size());
if(k%2)
ret.insert(ret.begin() , (int)ret.size());
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |