# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1225051 | PanosPask | Permutation (APIO22_perm) | C++20 | 1 ms | 328 KiB |
#include "perm.h"
#define pb push_back
using namespace std;
typedef long long ll;
vector<int> construct_permutation(ll k)
{
if (k == 1) {
return {};
}
vector<int> p;
if (k % 2 == 0) {
p = construct_permutation(k / 2);
p.pb(p.size());
}
else {
p = construct_permutation(k - 1);
for (int i = 0; i < p.size(); i++) {
p[i]++;
}
p.pb(0);
}
return p;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |