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
vector<int> construct_permutation(long long k)
{
k--;
vector<int> v;
deque<int> tmp;
deque<int> h;
int now = 0;
for (ll i = 0; i <= 60; i++) {
if ((1ll << i) & k) {
h.push_back(i);
for (now = now ; now < i; now++) {
// now++;
tmp.push_back(now);
}
now++;
}
}
for (auto it : h) {
tmp.push_back(it);
}
for (auto it : tmp) {
// cout << it << " ";
v.push_back(it);
}
// cout << "\n";
return v;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |