# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
155936 | junodeveloper | Teams (IOI15_teams) | C++14 | 1148 ms | 144580 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 "teams.h"
#include <bits/stdc++.h>
#define sz(x) (int)x.size()
using namespace std;
const int maxn=500000;
const int tmax=20*maxn+4*maxn;
int n,m;
int root[maxn+10];
int tree[tmax],tl[tmax],tr[tmax],tcnt;
vector<int> vx,vy;
int build(int s,int e) {
int u=++tcnt;
tree[u]=0;
if(s==e) return u;
int mid=(s+e)/2;
tl[u]=build(s,mid);
tr[u]=build(mid+1,e);
return u;
}
int update(int u,int s,int e,int p,int x) {
if(p<s||e<p) return u;
int nu=++tcnt;
tree[nu]=tree[u]+x;
if(s==e) return nu;
int mid=(s+e)/2;
tl[nu]=update(tl[u],s,mid,p,x);
tr[nu]=update(tr[u],mid+1,e,p,x);
return nu;
}
int query(int u,int s,int e,int l,int r) {
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... |