Submission #928999

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9289992024-02-17 12:43:11WarinchaiIndex (COCI21_index)C++14
110 / 110
411 ms136628 KiB
#include<bits/stdc++.h>
using namespace std;
int inf=1e9;
struct segtree{
struct node{
int sum;
node *l,*r;
node(int x=0){
sum=x;
l=r=NULL;
}
};
typedef node* pnode;
pnode rt[200005];
int getsum(pnode x){
return x?x->sum:0;
}
void upd(int st,int en,pnode x,pnode &y,int pos,int val){
y=new node(*x);
if(st==en){
y->sum+=val;
return void();
}
int m=(st+en)/2;
if(pos<=m)upd(st,m,x->l,y->l,pos,val);
else upd(m+1,en,x->r,y->r,pos,val);
y->sum=getsum(y->l)+getsum(y->r);
}
int fans(int st,int en,pnode x,pnode y,int s=0){
if(st==en)return st;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...