# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
91891 | easrui | Growing Trees (BOI11_grow) | C++14 | 652 ms | 3704 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;
const int MAX = 1e5+5;
int N,M,A[MAX],T[4*MAX];
void upt(int l, int r, int st, int en, int pos, int val){
if(en<l || st>r) return;
if(l<=st && en<=r){
T[pos] += val;
return;
}
upt(l,r,st,(st+en)/2,pos*2,val);
upt(l,r,(st+en)/2+1,en,pos*2+1,val);
}
int get(int x, int st, int en, int pos){
if(en<x || st>x) return 0;
if(st==en) return T[pos];
return T[pos]+get(x,st,(st+en)/2,2*pos)+get(x,(st+en)/2+1,en,2*pos+1);
}
int sear(int h, int st, int en){
if(st==en) return st;
if(get((st+en)/2,1,N,1)>=h) return sear(h,st,(st+en)/2);
else return sear(h,(st+en)/2+1,en);
}
int main()
{
cin >> N >> M;
# | 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... |
# | 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... |