#pragma GCC optimize("O3", "fast-math", "unroll-loops", "no-stack-protector")
#include <bits/stdc++.h>
using namespace std;
#if !defined(ONLINE_JUDGE) and !defined(EVAL)
#include "template/debug.h"
#else
#define d(x...)
#endif
#define fr first
#define er erase
#define in insert
#define sc second
#define ll long long
#define pb push_back
#define vll vector<ll>
#define pll pair<ll,ll>
#define len(x) (ll) x.size()
#define all(x) x.begin(),x.end()
const ll INF = 1e9, INFL = 1e18;
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
const ll maxn = 2e5 + 5;
ll n, m, k = 0;
vector<int>merge(vector<int>a, vector<int>b){
for(ll i = 0; i < len(a); i ++) a[i] += len(b);
for(ll i = 0; i < len(b); i ++) a.pb(b[i]);
return a;
}
std::vector<int> construct_permutation(long long _k)
{
m = _k;
ll say = 0;
vector<int> cv;
for(ll i = 1; i <= 60; i ++){
if(m & (1LL << i)){
vector<int>t;
for(ll j = 0; j < i; j ++) t.pb(j);
cv = merge(cv, t);
say ++;
}
}
for(ll i = 0; i < say - 1; i ++){
cv = merge({0}, cv);
}
return cv;
}
// void _() {
// ll q;
// cin >> q;
// auto v = construct_permutation(q);
// for(auto i : v) cout << i << ' ' ;
// }
// signed main() {
// ll tm = clock();
// cin.tie(0)->sync_with_stdio(0);
// ll t = 1;
// // cin >> t;
// for(ll tt = 1; tt <= t; tt ++) _();
// cerr << "\n\033[1;31mTime: \033[1;30m" \
// << (double)(clock()-tm)/1000000 << "\033[1;32m seconds\n";
// }
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |