Submission #674699

#TimeUsernameProblemLanguageResultExecution timeMemory
674699PurpleCrayonPermutation (APIO22_perm)C++17
91.33 / 100
2 ms340 KiB
#include "perm.h" #include <bits/stdc++.h> using namespace std; #define ar array #define sz(v) int(v.size()) typedef long long ll; vector<int> construct_permutation(long long k) { int l = 63 - __builtin_clzll(k); int m = 0; deque<int> ans; for (int i = l-1; i >= 0; i--) { ans.push_back(m++); if ((k >> i) & 1) ans.push_front(m++); } return vector<int>(ans.begin(), ans.end()); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...