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
#define pb push_back
#define INF 1e18
#define ss second
#define ff first
ll n,m,i,j,ii,jj,l,r,k;
std::vector<int> construct_permutation(long long k)
{
vector<int> v,suffix;
l=1;
for(i=0;i<=60;i++){
if(l&k){
j=i;
}
l*=2;
}
l=1;
int r=0;
for(i=0;i<j;i++){
if(l&k){
suffix.pb(r);
r++;
}
l*=2;
v.pb(r);
r++;
}
for(i=suffix.size()-1;i>=0;i--) v.pb(suffix[i]);
return v;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |