# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1054670 | aymanrs | Bubble Sort 2 (JOI18_bubblesort2) | C++17 | 1128 ms | 760 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>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
std::vector<int> countScans(std::vector<int> A,std::vector<int> X,std::vector<int> V){
int Q=X.size();
std::vector<int> ans(Q);
int n = A.size();
for (int _=0;_<Q;_++) {
A[X[_]] = V[_];
vector<int> v = {0};
for(int i = 0;i < n;i++) {
bool f = false;
for(int j = 0;j < v.size();j++){
if(v[j] <= A[i]) {
f=true;
v[j]=A[i];
break;
}
}
if(!f) v.push_back(A[i]);
}
ans[_] = v.size()-1;
}
return ans;
}
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... |