# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
250234 | Vladikus004 | Deda (COCI17_deda) | C++14 | 981 ms | 4984 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 inf 2e9
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
const int N = 200000 + 3;
int n, q, t[N * 4];
void build(int v, int tl, int tr){
if (tl == tr){
t[v] = inf;
}else{
int tm = (tl + tr) / 2;
build(v * 2, tl, tm);
build(v * 2 + 1, tm + 1, tr);
t[v] = max(t[v * 2], t[v * 2 + 1]);
}
}
int get_min(int v, int tl, int tr, int l, int r){
if (l > r) return inf;
if (tl == l && tr == r){
return t[v];
}
int tm = (tl + tr) / 2;
return min(get_min(v * 2, tl, tm, l, min(r, tm)),
get_min(v * 2 + 1, tm + 1, tr, max(tm + 1, l), r));
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |