# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
958294 | pragmatist | Permutation (APIO22_perm) | C++17 | 681 ms | 692 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;
long long dp[6000];
int a[6000];
int mn;
vector<int> ans;
void go(long long k, int n, int p[]) {
for(int i = 1; i <= n; ++i) {
a[i] = p[i-1];
}
long long cur = 1;
for(int i = 1; i <= n; ++i) {
dp[i] = 1;
for(int j = 1; j < i; ++j) {
if(a[j]<a[i]) {
dp[i] += dp[j];
}
}
cur += dp[i];
}
if(cur>k) {
return;
}
int old = n;
while(cur<k) {
vector<pair<int, long long> > b;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |