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 <bits/stdc++.h>
#include "bubblesort2.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define fi first
#define se second
#define mp make_pair
vector<int> countScans(vector<int> A, vector<int> X, vector<int> V){
vector<int> outp;
int n = A.size();
int q = X.size();
int sol;
for(int iq = 0; iq < q; iq ++ ){
A[X[iq]] = V[iq];
vector<pii> cha;
sol = 0;
for(int i = 0 ; i < n; i ++ ){
cha.push_back(mp(A[i], i));
}
sort(cha.begin(), cha.end());
for(int i = 0 ; i < n; i ++ ){
sol = max(sol, cha[i].se - i);
}
outp.push_back(sol);
}
return outp;
}
# | 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... |