# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1095202 | haru09 | Bubble Sort 2 (JOI18_bubblesort2) | C++17 | 0 ms | 0 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 ll long long
#define fi first
#define se second
#define task "code"
const int ar = 5e5 + 5;
const ll mod = 1e9 + 7;
int n, q;
int a[ar];
int pos[ar], x[ar];
vector<int> nen;
set<int> lis[ar * 2];
int st[(1 << 21) + 5];
int lz[(1 << 21) + 5];
void down(int id, int l, int r)
{
if (lz[id] == 0) return;
st[id] += lz[id];
if (l != r)
{
lz[id << 1] += lz[id];
lz[id << 1 | 1] += lz[id];
}
lz[id] = 0;
}
void update(int id, int l, int r, int u, int v, int val)
{
if (u > v) return;