# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
223404 | jamielim | Matching (COCI20_matching) | C++14 | 31 ms | 25344 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;
int n;
pair<int,int> arr[100005];
pair<int,int> adj[2][100005];
vector<int> al[100005];
vector<pair<int,int> > hor,ver[100005];
struct node{
int s,e,m,v;
node *l,*r;
node(int S,int E){
s=S;e=E;m=(s+e)/2;v=0;
if(s!=e){l=new node(s,m);r=new node(m+1,e);}
}
void upd(int x,int add){
if(s==e){v+=add;return;}
if(x<=m)l->upd(x,add);
else r->upd(x,add);
v=l->v+r->v;
}
int qry(int x,int y){
if(s==x&&e==y)return v;
if(y<=m)return l->qry(x,y);
if(x>m)return r->qry(x,y);
return l->qry(x,m)+r->qry(m+1,y);
}
}*root; //point modify range sum query
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... |