# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
984748 | Uultan12 | Permutation (APIO22_perm) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <vector>
std::vector<int> construct_permutation(int64_t k) {
int n = 0;
while ((n * (n + 1)) / 2 < k) {
++n;
}
std::vector<int> permutation(n);
for (int i = 0; i < n; ++i) {
permutation[i] = i;
}
return permutation;
}