# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1118287 | patgra | Bubble Sort 2 (JOI18_bubblesort2) | C++17 | 36 ms | 15216 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>
#include "bubblesort2.h"
#define rep(a,b,c) for(auto a = (b); a != (c); a++)
#define repD(a,b,c) for(auto a = (b); a != (c); a--)
#define repIn(a, b) for(auto& a : (b))
#define repIn2(a, b, c) for(auto& [a, b] : (c))
#define ll long long
constexpr bool dbg = false;
#define DEBUG if constexpr(dbg)
#define DC DEBUG std::cerr
#define eol std::endl
constexpr ll maxn = 5e5 + 7, treeBase = 1 << 20, inf = 1e18 + 7;
std::map<std::pair<int, int>, int> map;
int n, q;
ll tree[2 * treeBase], lazy[2 * treeBase];
void fixNode(int v) {
// DC << "Fixin " << v << " -> ";
tree[v] = std::max(tree[2 * v] + lazy[2 * v], tree[2 * v + 1] + lazy[2 * v + 1]);
// DC << tree[v] << eol;
}
void add(int l, int r, ll x) {
DC << "add " << l << ' ' << r << ' ' << x << eol;
l += treeBase; r += treeBase;
lazy[l] += x;
if (l != r) lazy[r] += x;
# | 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... |