Submission #557218

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5572182022-05-04 21:29:31n0sk1llRice Hub (IOI11_ricehub)C++14
68 / 100
176 ms37456 KiB
#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];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...