| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 618036 | Lobo | Permutation (APIO22_perm) | C++17 | 2 ms | 340 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 "perm.h"
#include<bits/stdc++.h>
using namespace std;
#define int long long
vector<int32_t> construct_permutation(int k)
{
int lg = 0;
for(int i = 0; i <= 60; i++) {
if(k >= (1LL<<i)) lg = i;
}
deque<int> ans;
for(int i = lg-1; i >= 0; i--) {
if(i != lg) ans.push_back((int) ans.size());
if(k&(1LL<<i)) ans.push_front((int) ans.size());
}
vector<int32_t> vc;
for(auto x : ans) {
vc.push_back(x);
}
return vc;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
