# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1020277 | TAhmed33 | Permutation (APIO22_perm) | C++17 | 2 ms | 644 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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector <int> construct_permutation (ll k) {
if (k == 1) {
return {};
}
if (k == 2) {
return {0};
}
if (k == 3) {
return {1, 0};
}
auto g = construct_permutation(k / 4);
if (k % 4 == 0) {
g.push_back(int(g.size()));
g.push_back(int(g.size()));
return g;
}
if (k % 4 == 1) {
g.push_back(int(g.size()));
g.push_back(int(g.size()));
g.push_back(-1);
for (auto &i : g) i++;
return g;
}
if (k % 4 == 2) {
g.push_back(int(g.size()));
g.push_back(-1);
g.push_back(int(g.size()) - 1);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |