# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
128961 | EntityIT | Bubble Sort 2 (JOI18_bubblesort2) | C++14 | 2142 ms | 89804 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;
#define pb push_back
const int N = (int)5e5 + 5, Q = N, inf = (int)1e9 + 123;
int n, q, order_q[N], order_a[N];
struct It {
struct Node {
int cnt, mx, lz;
Node (int _cnt = 0, int _mx = -inf, int _lz = 0) : cnt(_cnt), mx(_mx), lz(_lz) {}
Node operator+ (const Node &_) const { return Node(cnt + _.cnt, max(mx, _.mx), 0); }
} node[N << 3];
void true_val (int nd, int Left, int Right) {
if (!node[nd].lz) return ;
node[nd].mx += node[nd].lz;
if (Left != Right) {
node[nd << 1].lz += node[nd].lz;
node[nd << 1 | 1].lz += node[nd].lz;
}
node[nd].lz = 0;
}
void upd_rep (int nd, int Left, int Right, int pos, int val_mx, int val_cnt) {
true_val(nd, Left, Right);
if (pos < Left || Right < pos) return ;
if (Left == Right) {
node[nd] = Node(val_cnt, val_mx, 0);
return ;
# | 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... |