Submission #920222

#TimeUsernameProblemLanguageResultExecution timeMemory
920222MilosMilutinovicPermutation (APIO22_perm)C++17
0 / 100
1 ms344 KiB
#include "perm.h" #include <bits/stdc++.h> using namespace std; vector<int> Solve(long long k) { if (k == 0) { return {}; } if (k == 1) { return vector<int>(1, 0); } vector<int> res; vector<int> v = Solve(k / 2); if (k % 2 == 1) { res.push_back(2 * (int) v.size()); } for (int i : v) { res.push_back(i + (int) v.size()); } for (int i : v) { res.push_back(i); } return res; } vector<int> construct_permutation(long long k) { return Solve(k); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...