Submission #1112119

#TimeUsernameProblemLanguageResultExecution timeMemory
1112119PagodePaivaPermutation (APIO22_perm)C++17
10 / 100
228 ms262144 KiB
#include<bits/stdc++.h> #include "perm.h" using namespace std; vector <int> solve(int k){ if(k == 1) return {}; if(k%2 == 0){ vector <int> ans = solve(k/2); ans.push_back(ans.size()); return ans; } vector <int> ans = solve(k-1); for(auto &x : ans){ x++; } ans.push_back(0); return ans; } vector<int> construct_permutation(long long k){ vector <int> ans = solve(k); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...