# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1185047 | equation_tracker | 순열 (APIO22_perm) | C++20 | 1 ms | 328 KiB |
#include "perm.h"
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
std::vector<int> construct_permutation(long long k)
{
vector<int> nums {};
const ll bitLen = (int)log2l(k) + 1;
ll x = 0;
for (; x < bitLen - 1; x++) nums.push_back(x);
for (ll i = bitLen - 2; i >= 0; i--) {
if (k & (1 << i)) {
nums.insert(nums.begin() + i, x++);
}
}
return nums;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |