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;
const int maxn = 500500;
int t[4 * maxn];
vector<int> countScans(vector<int> A,vector<int> X,vector<int> V){
int Q=X.size();
vector<int> answer;
int n = (int)A.size();
for(int i = 0; i < Q; i++){
A[X[i]] = V[i];
int res = 0;
for(int j = 0; j < n; j++){
int cnt = -1;
for(int h = 0; h < n; h++){
cnt += (A[h] <= A[j]);
}
res = max(res, j - cnt);
}
answer.push_back(res);
}
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... |