Submission #593416

#TimeUsernameProblemLanguageResultExecution timeMemory
593416mohammad_kilaniPermutation (APIO22_perm)C++17
71.22 / 100
11 ms1364 KiB
#include "perm.h" #include <bits/stdc++.h> using namespace std; std::vector<int> construct_permutation(long long k){ vector< int > arr; k--; for(long long i = 61;i > 0;i--){ while((1LL << i) - 1 <= k){ k -= (1LL << i) - 1; for(int j = 0 ;j < i;j++){ arr.push_back((int)arr.size() - j + (i - j - 1)); } } } reverse(arr.begin(),arr.end()); return arr; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...