# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
163902 | oolimry | Bubble Sort 2 (JOI18_bubblesort2) | C++14 | 3012 ms | 604 KiB |
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;
vector<int> countScans(vector<int> arr, vector<int> X, vector<int> V){
int q = X.size();
int n = arr.size();
vector<int> answer;
for(int i = 0;i < n;i++){
arr[i] *= -1;
}
for(int qq = 0;qq < q;qq++){
arr[X[qq]] = V[qq] * -1;
vector<int> L;
for(int i = 0;i < n;i++){
int a = arr[i];
int index = lower_bound(L.begin(), L.end(),a) - L.begin();
if(index == L.size()){
L.push_back(a);
continue;
}
L[index] = a;
}
answer.push_back(L.size() - 1);
}
return answer;
}
Compilation message (stderr)
# | 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... |