# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
713703 | kkts | Bubble Sort 2 (JOI18_bubblesort2) | C++14 | 495 ms | 78124 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;
const int N = 5e5 + 5;
int lz[4 * N], t[4 * N];
void push(int u, int l, int r) {
t[u] += lz[u];
if(l != r) lz[2 * u] += lz[u], lz[2 * u + 1] += lz[u];
lz[u] = 0;
}
void upd(int u, int st, int en, int l, int r, int v) {
if(lz[u]) push(u, l, r);
if(l > en || r < st) return;
if(st <= l && r <= en) {
lz[u] = v;
push(u, l, r);
return;
}
int mid = (l + r) / 2;
upd(2 * u, st, en, l, mid, v); upd(2 * u + 1, st, en, mid + 1, r, v);
t[u] = max(t[2 * u], t[2 * u + 1]);
}
std::vector<int> countScans(std::vector<int> A,std::vector<int> X,std::vector<int> V){
vector<pair<int,int>> v;
for(int i = 0; i < A.size(); i++) {
v.push_back({A[i], i});
}
for(int i = 0; i < X.size(); i++) {
v.push_back({V[i], X[i]});
}
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... |