Submission #838541

#TimeUsernameProblemLanguageResultExecution timeMemory
838541finn__Permutation (APIO22_perm)C++17
0 / 100
0 ms212 KiB
#include <bits/stdc++.h> #include "perm.h" using namespace std; vector<int> construct_permutation(long long k) { if (k == 1) return {}; for (int q : {2, 3, 5, 7, 11, 13, 17, 19, 23}) if (!(k % q) && k > q) { auto p = construct_permutation(k / q); auto s = construct_permutation(q); for (int &x : s) x += p.size(); p.insert(p.end(), s.begin(), s.end()); return p; } auto 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...