제출 #1068963

#제출 시각아이디문제언어결과실행 시간메모리
1068963kilikuma순열 (APIO22_perm)C++17
10 / 100
134 ms262144 KiB
#include "perm.h" #include <bits/stdc++.h> using namespace std; int cur; vector<int> ans; void construct(int k) { if (k == 1) { return; } if (k % 2 == 1) { construct(k - 1); ans.insert(ans.begin(), cur); cur ++; } else { construct(k / 2); ans.push_back(cur); cur ++; } return; } vector<int> construct_permutation(long long k) { cur = 0; ans.clear(); construct(k); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...