# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
441185 | peijar | Bubble Sort 2 (JOI18_bubblesort2) | C++17 | 4003 ms | 189776 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 MAXN = (1 << 21) + 1;
int iDeb[MAXN], iFin[MAXN], maxVal[MAXN], lazyAdd[MAXN];
set<int> ids[MAXN];
int curDelta[MAXN];
void pull(int iNoeud) {
maxVal[iNoeud] = max(maxVal[2 * iNoeud], maxVal[2 * iNoeud + 1]);
}
void push(int iNoeud) {
if (!lazyAdd[iNoeud])
return;
maxVal[iNoeud] += lazyAdd[iNoeud];
if (iDeb[iNoeud] < iFin[iNoeud]) {
lazyAdd[2 * iNoeud] += lazyAdd[iNoeud];
lazyAdd[1 + 2 * iNoeud] += lazyAdd[iNoeud];
} else {
curDelta[iDeb[iNoeud]] += lazyAdd[iNoeud];
}
lazyAdd[iNoeud] = 0;
}
void buildTree(int iNoeud, int deb, int fin) {
iDeb[iNoeud] = deb, iFin[iNoeud] = fin;
maxVal[iNoeud] = -1e9;
# | 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... |