Submission #973426

#TimeUsernameProblemLanguageResultExecution timeMemory
973426CDuongPermutation (APIO22_perm)C++17
91.33 / 100
2 ms600 KiB
#include "perm.h" #include <bits/stdc++.h> using namespace std; vector<int> construct_permutation(long long k) { vector<int> binary; while (k) { binary.push_back(k & 1); k >>= 1; } reverse(binary.begin(), binary.end()); deque<int> dq; int cnt = 0; for (int i = 1; i < (int)binary.size(); ++i) { dq.emplace_back(cnt++); if (binary[i]) dq.emplace_front(cnt++); } return {dq.begin(), dq.end()}; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...