Submission #1112167

#TimeUsernameProblemLanguageResultExecution timeMemory
1112167ortsacPermutation (APIO22_perm)C++17
64.62 / 100
10 ms1652 KiB
#include <bits/stdc++.h> #include "perm.h" #define int long long using namespace std; vector<int32_t> construct_permutation(int k) { deque<int> ans; k--; int curr = 0; for (int i = 0; i < 60; i++) { deque<int> toadd; if ((1LL << i) & k) { for (int j = 0; j < i; j++) toadd.push_back(curr++); toadd.push_front(curr++); } reverse(toadd.begin(), toadd.end()); for (auto u : toadd) ans.push_front(u); } vector<int32_t> nans; for (auto u : ans) nans.push_back(u); //for (auto u : nans) cout << u << " "; //cout << "\n"; return nans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...