# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
650351 | ymm | Bubble Sort 2 (JOI18_bubblesort2) | C++17 | 9027 ms | 18020 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>
#define Loop(x,l,r) for (ll x = (l); x < (ll)(r); ++x)
#define LoopR(x,l,r) for (ll x = (r)-1; x >= (ll)(l); --x)
typedef long long ll;
typedef std::pair<int, int> pii;
typedef std::pair<ll , ll > pll;
using namespace std;
const int S = 4096;
const int N = 500'032 + S;
int seg_mx[N/S][S*2-1];
int seg_cnt[N/S][S*2-1];
int val[N], cnt[N], val_srt[N], srt_ind[N];
int n;
void add_seg(int l, int r, int x, int t, int i, int b, int e)
{
if (l <= b && e <= r) {
seg_cnt[t][i] += x;
seg_mx[t][i] += x;
return;
}
if (r <= b || e <= l)
return;
add_seg(l, r, x, t, 2*i+1, b, (b+e)/2);
add_seg(l, r, x, t, 2*i+2, (b+e)/2, e);
seg_mx[t][i] = max(seg_mx[t][2*i+1], seg_mx[t][2*i+2]);
seg_mx[t][i] += seg_cnt[t][i];
}
# | 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... |