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;
typedef pair<ll, ll> pll;
#define X first
#define Y second
#define SZ(a) ((int)a.size())
#define ALL(v) v.begin(), v.end()
#define pb push_back
vector<int> construct_permutation(ll k) {
if (k == 1)
return {};
if (k == 2)
return {0};
if (k & 1) {
vector<int> rt = construct_permutation(k - 1);
for (int &i : rt)
++i;
rt.pb(0);
return rt;
}
vector<int> rt = construct_permutation(k / 2);
rt.pb(SZ(rt));
return rt;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |