# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
557218 | n0sk1ll | Rice Hub (IOI11_ricehub) | C++14 | 176 ms | 37456 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 "ricehub.h"
#include<bits/stdc++.h>
using namespace std;
long long int typedef li;
//1-root obicnog, 2-root kurca
int val[10000007],L[10000007],R[10000007],idx=2;
void add(int p, int l, int r, int s, int x)
{
val[p]+=x;
if (l==r) return;
int mid=(l+r)/2;
if (s<=mid)
{
if (!L[p]) L[p]=++idx;
add(L[p],l,mid,s,x);
}
else
{
if (!R[p]) R[p]=++idx;
add(R[p],mid+1,r,s,x);
}
}
int sum(int p, int l, int r, int ll, int rr)
{
if (!p || ll>r || rr<l) return 0;
if (ll<=l && rr>=r) return val[p];
# | 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... |