# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
602591 | patrikpavic2 | Permutation (APIO22_perm) | C++17 | 1 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 <vector>
#include <algorithm>
#define PB push_back
using namespace std;
typedef vector < int > vi;
typedef long long ll;
vi construct_permutation(long long k){
k--;
if(k == 0) return {};
if(k == 1) return {0};
if(k == 2) return {1, 0};
if(k > 7 && k % 7 == 6){
vi st = construct_permutation((k - 6) / 7 + 1);
st.PB((int)st.size() + 2);
st.PB((int)st.size());
st.PB((int)st.size() + 1);
st.PB((int)st.size() - 3);
return st;
}
if(k > 5 && k % 5 == 4){
vi st = construct_permutation((k - 4) / 5 + 1);
st.PB((int)st.size() + 1);
st.PB((int)st.size() + 1);
st.PB((int)st.size() - 2);
return st;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |