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(), q = X.size();
vector<int> ans(q);
for(int it=0; it<q; it++) {
A[X[it]] = V[it];
vector<int> B = A;
while(!is_sorted(B.begin(), B.end())) {
ans[it]++;
for(int i=0; i+1<n; i++) if(B[i] > B[i+1]) swap(B[i], B[i+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... |