#include <bits/stdc++.h>
#define int long long
#define F first
#define S second
#define pb push_back
#define all(x) x.begin() , x.end()
using namespace std;
vector<int> construct_permutation(int k) {
vector<pair<pair<int , int> , int>> vec;
for(int i = 60 ; ~i ; i--) if((1ll << i) & k) {
if(vec.size()) vec.pb({{i + 1 , 0} , vec.size()});
else
for(int j = 1 ; j <= i ; j++)
vec.pb({{j , 1} , vec.size()});
}
sort(all(vec));
// cout << vec.size() << "\n";
vector<int> ans(vec.size());
for(int i = 0 ; i < vec.size() ; i++)
ans[vec[i].S] = i;
return ans;
}
// signed main() {
// int n;
// cin >> n;
// while(n--) {
// int k;
// cin >> k;
// vector<int> vec = construct_permutation(k);
// for(auto x : vec) cout << x << " ";
// cout << "\n";
// }
// }
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |