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 <vector>
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> ret(q);
for(int t = 0; t < q; ++t) {
a[x[t]] = v[t];
int ans = 0;
for(int i = 1; i < n; ++i) {
int cnt = 0;
for(int j = 0; j < i; ++j) {
if(a[j] > a[i]) {
++cnt;
}
}
ans = max(ans, cnt);
}
ret[t] = ans;
}
return ret;
}
# | 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... |