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;
vector<int> countScans(vector<int> a, vector<int> X, vector<int> V) {
int n = a.size();
int Q = X.size();
vector<int> finans;
for (int i = 0; i < Q; i++) {
a[X[i]] = V[i];
int ans = 0;
for (int j = 0; j < n; j++) {
for (int k = j + 1; k < n; k++) {
if (a[j] > a[k]) ans = max(ans, k - j);
}
}
finans.push_back(ans);
}
return finans;
}
# | 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... |