# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
206457 | GioChkhaidze | Bubble Sort 2 (JOI18_bubblesort2) | C++14 | 1783 ms | 72060 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 Tree int h,int l,int r
#define Left (h<<1),l,(l+r)>>1
#define Right ((h<<1)|1),((l+r)>>1)+1,r
#define ll long long
#define pb push_back
#define F first
#define S second
using namespace std;
const int N=5e5+5;
int n,q,Xx,Yy,L,R,dl,S,a[N],pos[N],x[N],inf=-1e9;
vector < int > answer;
vector < pair < pair < int , int > , pair < bool , int > > > s;
typedef struct { int x; int add; } res;
res v[8*N];
inline void Shift(Tree) {
if (!v[h].add) return ;
v[(h<<1)].x+=v[h].add;
v[((h<<1)|1)].x+=v[h].add;
v[(h<<1)].add+=v[h].add;
v[((h<<1)|1)].add+=v[h].add;
v[h].add=0;
}
void Upd(Tree) {
if (R<l || r<L) return ;
if (L<=l && r<=R) { v[h].add+=dl; v[h].x+=dl; return ; }
Shift(h,l,r);
# | 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... |