| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1357322 | kawhiet | Permutation (APIO22_perm) | C++20 | 4 ms | 1348 KiB |
#include <bits/stdc++.h>
#include "perm.h"
using namespace std;
vector<int> construct_permutation(long long k) {
int mx = 5000;
vector<int> a;
for (int i = 60; i >= 0; i--) {
long long x = 1LL << i;
while (k > (x - 1)) {
if (x - 1 == 0) {
break;
}
k -= x - 1;
for (int j = 0; j < i; j++) {
a.push_back(mx - i + j);
}
mx -= i;
}
}
int mn = ranges::min(a);
for (auto &x : a) {
x -= mn;
}
return a;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
