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 ;
int n;
std::vector<int> countScans(std::vector<int> A,std::vector<int> X,std::vector<int> V){
int Q=X.size();
n = (int) A.size() ;
std::vector<int> answer(Q);
for (int j=0;j<Q;j++) {
A[ X[j] ] = V[ j ] ;
vector<pair<int , int > > tmp ;
int ret = 0 ;
for(int i = 0 ; i < n ;i++){
tmp.push_back({A[i] , i}) ;
}
sort(tmp.begin() , tmp.end()) ;
for(int i = 0 ;i < n ;i++){
ret = max(ret , tmp[i].second - i) ;
}
answer[j] = ret ;
}
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... |