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 "bubblesort2.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 10;
int dp[MAXN];
vector<int> countScans(vector<int> A, vector<int> X, vector<int> V){
int q = X.size(), n = A.size();
vector<int> ans;
for (int i = 0; i < q; i++) {
A[X[i]] = V[i];
int f = 0;
for (int i = 0; i < n; i++) {
dp[i] = 1;
for (int j = 0; j < i; j++) {
if (A[j] > A[i])
dp[i]++;
}
f = max(f, dp[i]);
}
ans.push_back(f - 1);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |