# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
311152 | shivensinha4 | Cake (CEOI14_cake) | C++17 | 1586 ms | 10020 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.
/*
* Similar to editorial, but I just use one segment tree that supports updates and range max.
* To find "longest sequence such that all elements are less that d starting at a" on either side of a, I use binary search.
* This does make it log^2(n), but passes easily.
*/
#include <bits/stdc++.h>
using namespace std;
#define for_(i, s, e) for (int i = s; i < (int) e; i++)
#define for__(i, s, e) for (ll i = s; i < e; i++)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
#define endl '\n'
class SegmentTree {
private:
vi tree, raw; int n;
int merge(int a, int b) {
return max(a, b);
}
void buildTree(int l, int r, int p) {
if (l == r) {
tree[p] = raw[l];
return;
}
int mid = (l + r) / 2;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |