제출 #739263

#제출 시각아이디문제언어결과실행 시간메모리
739263CyberCraze순열 (APIO22_perm)C++17
91.33 / 100
2 ms340 KiB
#include <bits/stdc++.h>
#define ll long long
using namespace std;

vector<int> construct_permutation(ll k) {
  int z = __lg(k);
  vector<int> p(z);
  iota(p.begin(), p.end(), 0);
  for (int i = z - 1; i >= 0; i--) {
    if ((k >> i) & 1) {
      p.insert(p.begin() + i, z++);
    }
  }
  return p;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...