# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
385632 | keta_tsimakuridze | Bubble Sort 2 (JOI18_bubblesort2) | C++14 | 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>
#include "bubblesort2.h"
#define f first
#define int long long
#define s second
using namespace std;
const int N=2e5+5,mod=1e9+7;
int t,lazy[4*N],ind[N],b[N],a[N],n,q;
map<pair<int,int>,int>idx;
string s;
vector<pair<int,int> >p;
pair<int,int> tree[4*N];
vector<int>ans;
void update(int u,int start,int end,int l,int r,int type,int val){
if(lazy[u]){
tree[u].s+=lazy[u];
if(l!=r){
lazy[2*u]+=lazy[u];
lazy[2*u+1]+=lazy[u];
}
lazy[u]=0;
}
if(l>end || r<start) return;
if(start<=l && r<=end){
if(type==1) {
tree[u].f+=val;
return;
}
tree[u].s+=val;
lazy[u]=val;