# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
204179 | DS007 | Bubble Sort 2 (JOI18_bubblesort2) | C++14 | 5698 ms | 168648 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 <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 1000;
map<int, int> m;
int t[N * 8], lazy[N * 8];
multiset<int> pos[N];
void push_down(int v) {
t[v] += lazy[v];
lazy[v * 2] += lazy[v];
lazy[v * 2 + 1] += lazy[v];
lazy[v] = 0;
}
void update(int v, int l, int r, int tl, int tr, int val) {
if (tl > tr)
return;
push_down(v); push_down(v * 2); push_down(v * 2 + 1);
if (l == tl && r == tr) {
lazy[v] += val;
push_down(v);
return;
}
int mid = (l + r) / 2;
update(v * 2, l, mid, tl, min(mid, tr), val);
update(v * 2 + 1, mid + 1, r, max(tl, mid + 1), tr, val);
t[v] = max(t[v * 2], t[v * 2 + 1]);
}
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... |