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;
typedef long long ll;
typedef pair<int, int> pii;
#define fi first
#define se second
#define mp make_pair
vector<int> construct_permutation(ll k)
{
if(k == 1) return {};
if(k % 2 == 1){
vector<int> sol = construct_permutation(k - 1);
vector<int> res;
res.push_back(sol.size());
for(auto x : sol) res.push_back(x);
return res;
}
else{
vector<int> sol = construct_permutation(k / 2ll);
sol.push_back(sol.size());
return sol;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |