# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
659460 | vivo2006 | Deda (COCI17_deda) | C++14 | 478 ms | 10980 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 int long long
using namespace std;
int n, q, val, a, b;
int tree[800008];
char type;
void update(int ind, int index, int l, int r)
{
//cout<<ind<<" "<<l<<" "<<r<<endl;
if(l == r)
{
tree[ind] = a;
//cout<<tree[ind]<<endl;
return;
}
int mid = (l + r) / 2;
if(index <= mid) update(ind * 2 + 1, index, l, mid);
else update(ind * 2 + 2, index, mid + 1, r);
tree[ind] = min(tree[ind * 2 + 1], tree[ind * 2 + 2]);
//cout<<tree[ind]<<endl;
}
int bsa(int ind, int l, int r)
{
//cout<<l<<" "<<r<<": "<<tree[ind]<<endl;
if(tree[ind] > a) return 1000000001;
if(l == r) return l;
int mid = (l + r) / 2;
if(tree[ind * 2 + 1] <= a) return bsa(ind * 2 + 1, l, mid);
if(tree[ind * 2 + 2] <= a) return bsa(ind * 2 + 2, mid + 1, r);
return 1000000001;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |