# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
164003 | TadijaSebez | 절취선 (JOI14_ho_t5) | C++11 | 2927 ms | 126668 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 pb push_back
#define mt make_tuple
#define ll long long
const int N=100050;
int X1[N],X2[N],Y1[N],Y2[N];
vector<tuple<int,int,int>> events;
int ls[N],rs[N],pri[N],val[N],idx[N],tsz,root,sum[N],tag[N],deg[N],sz[N],L[N],R[N];
bool ban[N];
int Make(int v, int i)
{
tsz++;
pri[tsz]=rand()+(rand()<<15);
val[tsz]=v;
sz[tsz]=1;
deg[tsz]=0;
L[tsz]=R[tsz]=v;
idx[tsz]=i;
sum[tsz]=tag[tsz]=ls[tsz]=rs[tsz]=0;
return tsz;
}
void upd(int x, int f){ if(x) sum[x]=sz[x],deg[x]+=f,tag[x]+=f;}
void push(int x){ if(tag[x]) upd(ls[x],tag[x]),upd(rs[x],tag[x]),tag[x]=0;}
void pull(int x)
{
if(!x) return;
push(x);
sz[x]=sz[ls[x]]+1+sz[rs[x]];
sum[x]=sum[ls[x]]+(deg[x]!=0)+sum[rs[x]];
Compilation message (stderr)
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |