제출 #745260

#제출 시각아이디문제언어결과실행 시간메모리
745260speedyArda순열 (APIO22_perm)C++17
0 / 100
1 ms296 KiB
#include "perm.h" #include "bits/stdc++.h" using namespace std; vector<int> construct_permutation(long long k) { int beg = log2(k); vector<int> ans; for(int i = 0; i < beg; i++) ans.push_back(i); long long rem = k - (1LL << beg); for(long long i = beg - 1; i >= 0; i--) { if(rem & (1 << i)) { rem -= (1 << i); ans.push_back(beg++); } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...