Submission #838538

#TimeUsernameProblemLanguageResultExecution timeMemory
838538finn__Permutation (APIO22_perm)C++17
93.33 / 100
2 ms356 KiB
#include <bits/stdc++.h> #include "perm.h" using namespace std; vector<int> construct_permutation(long long k) { if (k == 1) return {}; vector<int> p; if (!(k % 2)) { p = construct_permutation(k >> 1); p.push_back(p.size()); } else if (!(k % 3)) { p = construct_permutation(k / 3); p.push_back(p.size() + 1); p.push_back(p.size() - 1); } else { p = construct_permutation(k >> 1); p.push_back(p.size()); p.insert(p.begin(), p.size()); } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...