제출 #572701

#제출 시각아이디문제언어결과실행 시간메모리
572701baluteshih순열 (APIO22_perm)C++17
71.22 / 100
11 ms1364 KiB
#include "perm.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define X first #define Y second #define SZ(a) ((int)a.size()) #define ALL(v) v.begin(), v.end() #define pb push_back vector<int> construct_permutation(ll k) { vector<int> idx, rt; --k; for (ll x = 59; x > 0; --x) { while (k >= (1LL << x) - 1) { k -= (1LL << x) - 1; idx.pb(x); } } int nw = -1; for (int x : idx) { for (int i = nw + x; i > nw; --i) rt.pb(i); nw += x; } reverse(ALL(rt)); return rt; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...