# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
970697 | mannshah1211 | Permutation (APIO22_perm) | C++17 | 0 ms | 344 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 "perm.h"
using namespace std;
vector<int> construct_permutation(long long k) {
if (k == 2) {
return vector<int>(1, 0);
}
if (k % 2 == 1) {
vector<int> bef = construct_permutation(k - 1);
vector<int> ans = bef;
for (int &v : ans) {
v++;
}
ans.push_back(0);
} else {
vector<int> bef = construct_permutation(k / 2);
vector<int> ans = bef;
ans.push_back(ans.size());
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |