제출 #876446

#제출 시각아이디문제언어결과실행 시간메모리
876446alexdd순열 (APIO22_perm)C++17
71.22 / 100
10 ms1372 KiB
#include<iostream> #include<vector> #include<algorithm> #include "perm.h" using namespace std; std::vector<int> construct_permutation(long long k) { vector<int> sol; int cnt=0; k--; for(int i=60;i>0;i--) { while(k>=(1LL<<i)-1) { for(int j=cnt+i-1;j>=cnt;j--) sol.push_back(j); cnt += i; k -= (1LL<<i)-1; } } reverse(sol.begin(),sol.end()); return sol; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...