# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
826317 | 12345678 | Deda (COCI17_deda) | C++17 | 81 ms | 7892 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 nx=2e5+5;
int n, q, x, y;
char opr;
struct segtree
{
int d[4*nx];
void update(int l, int r, int i, int idx, int val)
{
if (idx<l||r<idx) return;
if (l==r) return void(d[i]=val);
int md=(l+r)/2;
update(l, md, 2*i, idx, val);
update(md+1, r, 2*i+1, idx, val);
d[i]=min(d[2*i], d[2*i+1]);
}
int query(int l, int r, int i, int B, int Y)
{
if (r<B||d[i]>Y) return -1;
if (l==r) return l;
int md=(l+r)/2, lf=query(l, md, 2*i, B, Y);
if (lf!=-1) return lf;
return query(md+1, r, 2*i+1, B, Y);
}
} s;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |