이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "perm.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<int> construct_permutation(ll k){
	if (k == 1ll) return {};
	if (k == 2ll) return {0};
	for (int p : {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31}) 
		if (k%p == 0ll && k > p) {
			vector<int> a = construct_permutation(p);
			vector<int> b = construct_permutation(k/p);
			for (auto& x : b)
				x += a.size();
			a.insert(a.end(), b.begin(), b.end());
			return a;
		}
	vector<int> res = construct_permutation(k >> 1ll);
	res.push_back(res.size());
	res.insert(res.begin(), res.size());
	return res;
}
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |