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>
//#include <vector>
#define pb push_back
#define ll long long
using namespace std;
vector<int> construct_permutation(long long k){
int l = 0;
for (int i = 60; i >= 0; i--)
if (((1LL<<i)&k)) {l = i; break;}
vector <int> v; v.clear();
for (int i=0;i<l;i++) v.pb(i);
ll val = l - 1;
for (int i = l-1; i >= 0; i--)
if (((1LL<<i)&k))
v.insert(v.begin() + i, ++val);
return v;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |