# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
788229 | Charizard2021 | Bubble Sort 2 (JOI18_bubblesort2) | C++17 | 1974 ms | 51528 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 = 1000001;
vector<pair<int, int> > val;
int T[N << 2], SegTree[N << 2];
void push(int s, int l, int r) {
if (!SegTree[s]){
return;
}
T[s] += SegTree[s];
if (l != r) {
SegTree[s << 1] += SegTree[s];
SegTree[s << 1 | 1] += SegTree[s];
}
SegTree[s] = 0;
}
void up(int s, int l, int r, int from, int to, int val) {
push(s, l, r);
if (l > to || r < from) return;
if (from <= l && r <= to) {
SegTree[s] += val;
push(s, l, r);
return;
}
int mid = l + r >> 1;
up(s << 1, l, mid, from, to, val);
up(s << 1 | 1, mid + 1, r, from, to, val);
T[s] = max(T[s << 1], T[s << 1 | 1]);
}
vector<int> countScans(vector<int> a, vector<int> pos, vector<int> val2) {
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... |