This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "perm.h"
#include <bits/stdc++.h>\
using namespace std;
vector<int> construct_permutation(long long k) {
if(k > 90) return {};
vector<int> mas;
vector<int> ret;
int ind = 0;
for(int i = 2; i <= k; i++) {
// cout << "i = " << i << ", k = " << k << endl;
if(k % i == 0) {
// cout << "i = " << i << ", R = " << ind + i -1 << ", L = " << ind << endl;
for(int j = ind + i - 2; j >= ind; j--) {
ret.push_back(j);
}
ind += i-1;
k /= i;
i--;
}
}
// cout << "ret: "; for(auto x : ret) cout << x << " ";
//cout << endl;
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |