# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
226577 | MKopchev | Growing Trees (BOI11_grow) | C++14 | 149 ms | 3832 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 nmax=1e5+42;
int n,q;
int inp[nmax];
long long pref[nmax];
void update(int pos,int val)
{
//cout<<"update "<<pos<<" "<<val<<endl;
while(pos<=n)
{
pref[pos]+=val;
pos=pos+(pos&(-pos));
}
}
void update_interval(int l,int r,int val)
{
//cout<<"update_interval "<<l<<" "<<r<<" "<<val<<endl;
update(l,val);
update(r+1,-val);
}
int query(int pos)
{
//cout<<"query "<<pos<<endl;
long long ret=0;
while(pos)
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... |
# | 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... |