# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
621469 | gromperen | 순열 (APIO22_perm) | C++17 | 2 ms | 340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "perm.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
vector<int> construct_permutation(ll k) {
vector<int> ans;
int x = __lg(k);
for (int i = 0; i < x; ++i) ans.push_back(i);
for (int i = x - 1; i >= 0; --i) {
if ((k>>i)&1) {
ans.insert(ans.begin()+i, x);
x++;
}
}
return ans;
}
/*
vector<int> construct_permutation(ll k)
{
k--;
vector<int> ans;
int mx = 0;
while (k > 0) {
int i = 60;
while ((1LL << i) - 1 > k) {
i--;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |