Submission #912421

#TimeUsernameProblemLanguageResultExecution timeMemory
912421stegatxins0Permutation (APIO22_perm)C++17
10 / 100
1 ms600 KiB
#include <bits/stdc++.h> #include "perm.h" using namespace std; using ll = long long; std::vector<int> construct_permutation(long long k) { bitset<64> bs(k); vector<int> ans; int n = (int)log2(k); //int maxx=n-1; int cur=n-1; for(int i=0;i<n;i++){ ans.push_back(i); } n--; while(n>=0){ if(bs[n]&1){ ans.insert(ans.begin()+n, ++cur); } n--; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...