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<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> II;
const int N = 1e5 + 5, logN = 20;
const int MOD = 1e9 + 7;
const ll INF = 1e9;
vector<int> construct_permutation(ll k){
vector<int> ans;
int m = 0;
for(int i = 59; i >= 0; i --){
if(k >> i & 1){
m = i;
break;
}
}
for(int i = 0; i < m; i ++) ans.push_back(i);
int cur = m - 1;
for(int i = m - 1; i >= 0; i --){
if(k >> i & 1){
ans.insert(ans.begin() + i, ++ cur);
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |