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>
#define pii pair<int,int>
#define i1 first
#define i2 second
using namespace std;
vector<int> countScans(vector<int> A,vector<int> X,vector<int> V){
int N=A.size();
int Q=X.size();
vector<int> H(Q);
vector<pii> S(N);
for (int i=0;i<Q;i++) {
A[X[i]]=V[i];
for (int j=0;j<N;j++) {
S[j]={A[j],j};
}
sort(S.begin(),S.end());
for (int j=0;j<N;j++) {
H[i]=max(H[i],S[j].i2-j);
}
}
return H;
}
# | 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... |