# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
210798 | 2qbingxuan | Bubble Sort 2 (JOI18_bubblesort2) | C++14 | 847 ms | 50048 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>
#define pb emplace_back
#define get_pos(u,x) (lower_bound(begin(u),end(u),x) - begin(u))
using namespace std;
typedef long long ll;
const ll N = 500025, INF = 1e18;
struct Segtree {
ll mx[N<<1],lz[N];
void upd(int p, ll d) {
mx[p] += d;
if(p < N) lz[p] += d;
}
void pull(int p) {
for(; p>1; p>>=1) mx[p>>1] = max(mx[p],mx[p^1]) + lz[p>>1];
}
void push(int p) {
for(int h = __lg(N); h >= 0; h--) {
int i = p>>h;
if(!lz[i>>1]) continue;
upd(i,lz[i>>1]);
upd(i^1,lz[i>>1]);
lz[i>>1] = 0;
}
}
void add(int l, int r, ll d) {
int L = l, R = r;
for(l+=N,r+=N; l<r; l>>=1,r>>=1) {
if(l&1) upd(l++, d);
if(r&1) upd(--r, d);
# | 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... |