제출 #970699

#제출 시각아이디문제언어결과실행 시간메모리
970699mannshah1211순열 (APIO22_perm)C++17
91.33 / 100
2 ms484 KiB
#include "perm.h" using namespace std; vector<int> construct_permutation(long long k) { if (k == 2) { return vector<int>(1, 0); } if (k % 2 == 1) { vector<int> bef = construct_permutation(k - 1); vector<int> ans = bef; for (int &v : ans) { v++; } ans.push_back(0); return ans; } vector<int> bef = construct_permutation(k / 2); vector<int> ans = bef; ans.push_back(ans.size()); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...