#include <bits/stdc++.h>
#include "bubblesort2.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> answer(q);
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 += 1;
}
}
}
answer[i] = ans;
}
return answer;
}
# | 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... |