# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
83353 | faceless | Deda (COCI17_deda) | C++17 | 451 ms | 17084 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 MP make_pair
#define F first
#define PB push_back
#define S second
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
const int mod = (int)1e9 + 7;
const int maxn = 2e5 + 4;
const int inf = 1e9 + 1;
int seg[4 * maxn];
int get (int id, int L, int R, int l, int r, int x) {
if (seg[id] > x)
return -1;
if (L == l and R == r) {
if (L + 1 == R)
return L;
int mid = (L + R) >> 1;
int ret = get (2 * id + 0, L, mid, L, mid, x);
if (ret != -1)
return ret;
return get (2 * id + 1, mid, R, mid, R, x);
}
int ret = -1, mid = (L + R) >> 1;
if (mid > l)
ret = get (2 * id + 0, L, mid, l, min (mid, r), x);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |