# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
577119 | eecs | Exercise Deadlines (CCO20_day1problem2) | C++17 | 91 ms | 6192 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 maxn = 200010;
int n, d[maxn], p[maxn];
#define mid ((l + r) >> 1)
#define ls (k << 1)
#define rs (k << 1 | 1)
int mx[maxn << 2];
void build(int k, int l, int r) {
if (l == r) { mx[k] = d[l]; return; }
build(ls, l, mid), build(rs, mid + 1, r);
mx[k] = max(mx[ls], mx[rs]);
}
void upd(int k, int l, int r, int p) {
if (l == r) { mx[k] = 0; return; }
mid >= p ? upd(ls, l, mid, p) : upd(rs, mid + 1, r, p);
mx[k] = max(mx[ls], mx[rs]);
}
int find(int k, int l, int r, int v) {
if (l == r) return l;
return mx[rs] >= v ? find(rs, mid + 1, r, v) : find(ls, l, mid, v);
}
namespace BIT {
int c[maxn];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |