# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
83594 | ToadDaveski | Simple game (IZhO17_game) | C++14 | 472 ms | 35560 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>
#define ll long long
#define INF 1000000
using namespace std;
ll t[8000001];
ll a[100001];
void update(ll x,ll l,ll r,ll tl,ll tr,ll value)
{
//cout<<l<<" "<<r<<" "<<tl<<" "<<tr<<endl;
if (tl>tr)
return;
if (tl==l && tr==r)
{
t[x]+=value;
//cout<<l<<" "<<r<<" "<<t[x]<<endl;
return ;
}
else
{
ll bm=(l+r)/2;
update(x*2,l,bm,tl,min(tr,bm),value);
update(x*2+1,bm+1,r,max(bm+1,tl),tr,value);
}
}
ll findans(ll x,ll l,ll r,ll poz)
{
//cout<<x<<" "<<l<<" "<<r<<" "<<t[x]<<endl;
if (l==r)
return t[x];
else
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... |