# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
789672 | GusterGoose27 | Permutation (APIO22_perm) | C++17 | 51 ms | 340 KiB |
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;
typedef long long ll;
const int test = 9;
const int max_use = 100;
vector<int> table[(1 << test)+1];
bool made = 0;
void construct(ll k, int s, deque<int> &ans) {
if (k == 1) return;
for (int i = 2; i <= max_use; i++) {
if (table[i].empty() || !(k%i == 0)) continue;
construct(k/i, s+table[i].size(), ans);
for (int j = table[i].size()-1; j >= 0; j--) ans.push_front(s+table[i][j]);
return;
}
construct(k-1, s+1, ans);
ans.push_back(s);
}
bool vis[test];
int bit[test+1];
void upd(int p, int v, int n) {
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |