| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1225045 | SpyrosAliv | Permutation (APIO22_perm) | C++20 | 0 ms | 320 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
vector<int> construct_permutation(ll k) {
k--;
vector<int> perm;
vector<int> bits;
for (int i = 0; i < 61; i++) {
if (!((k >> i) & 1)) continue;
bits.push_back(i);
}
int curr = 0;
for (auto x: bits) {
int prev = curr;
curr += x;
for (int j = prev+1; j <= curr; j++) {
perm.push_back(j);
}
perm.push_back(prev);
curr++;
}
return perm;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
