# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
496048 | 600Mihnea | Bubble Sort 2 (JOI18_bubblesort2) | C++17 | 9072 ms | 600 KiB |
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> pos, vector<int> value){
int n = (int) a.size();
int q = (int) pos.size();
assert(q == (int) value.size());
vector<int> sol;
for (int it = 0; it < q; it++) {
a[pos[it]] = value[it];
int MX = 0;
for (int i = 0; i < n; i++) {
int bigger = 0;
for (int j = 0; j < i; j++) {
if (a[j] > a[i]) {
bigger++;
}
}
MX = max(MX, bigger);
}
sol.push_back(MX);
}
return sol;
}
# | 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... |