| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1362442 | aaaaaaaa | Permutation (APIO22_perm) | C++20 | 0 ms | 344 KiB |
#include <bits/stdc++.h>
#include "perm.h"
using namespace std;
vector<int> construct_permutation (long long k) {
long long pw = 2, len = 1;
while (pw * 2 - 1 <= k) {
len += 1;
pw *= 2;
}
long long temp = k - pw - 1;
vector <int> ans;
for (int i = 0; i < len; ++i) ans.push_back(i);
reverse(ans.begin(), ans.end());
for (int i = len; i <= len + temp; ++i) ans.push_back(i);
reverse(ans.begin(), ans.end());
// for (auto it : ans) cout << it << "\n";
return ans;
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
