Submission #911332

#TimeUsernameProblemLanguageResultExecution timeMemory
911332four_specksPermutation (APIO22_perm)C++17
0 / 100
0 ms348 KiB
#include "perm.h" #include <bits/stdc++.h> using namespace std; std::vector<int> construct_permutation(long long k) { vector<int> ans; int h = __lg(k); for (int i = 0, j = 0; i < h; i++) { while (j < h && k >> j & 1) { j++; } ans.push_back(j++); } for (int i = h - 1; i >= 0; i--) { if (k >> i & 1) { ans.push_back(i); } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...