제출 #838538

#제출 시각아이디문제언어결과실행 시간메모리
838538finn__순열 (APIO22_perm)C++17
93.33 / 100
2 ms356 KiB
#include <bits/stdc++.h> #include "perm.h" using namespace std; vector<int> construct_permutation(long long k) { if (k == 1) return {}; vector<int> p; if (!(k % 2)) { p = construct_permutation(k >> 1); p.push_back(p.size()); } else if (!(k % 3)) { p = construct_permutation(k / 3); p.push_back(p.size() + 1); p.push_back(p.size() - 1); } else { p = construct_permutation(k >> 1); p.push_back(p.size()); p.insert(p.begin(), p.size()); } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...