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;
using ll = long long;
using vll = vector <ll>;
using vi = vector <int>;
vi countScans (vi a, vi wh, vi val) {
vll ve(a.begin(), a.end());
ll n = a.size();
ll Q = wh.size();
vi ans;
for (ll q = 0; q < Q; q++) {
ve[wh[q]] = val[q];
vector <pair <ll, ll> > th;
for (ll i = 0; i < n; i++) {
th.push_back({ ve[i], i });
}
sort(th.begin(), th.end());
ll qans = 0;
for (ll i = 0; i < n; i++) {
qans = max(qans, th[i].second - i);
}
ans.push_back(qans);
}
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... |