제출 #605390

#제출 시각아이디문제언어결과실행 시간메모리
605390AugustinasJucas순열 (APIO22_perm)C++17
10 / 100
1 ms296 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...