# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
452139 | rainboy | Comparing Plants (IOI20_plants) | C++17 | 1046 ms | 75328 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 "plants.h"
#include <stdlib.h>
#include <string.h>
using namespace std;
typedef vector<int> vi;
const int N = 200000, LN = 18, N_ = 1 << LN, INF = 0x3f3f3f3f; /* LN = ceil(log2(N)) */
int min(int a, int b) { return a < b ? a : b; }
int max(int a, int b) { return a > b ? a : b; }
int aa[N], ii[N], n, k;
int st[N_ * 2], lz[N_ * 2], first[N_ * 2], last[N_ * 2], gap[N_ * 2], n_;
void put(int i, int x) {
st[i] += x, lz[i] += x;
}
void pul(int i) {
int l = i << 1, r = l | 1;
if (st[l] < st[r])
st[i] = st[l], first[i] = first[l], last[i] = last[l], gap[i] = gap[l];
else if (st[l] > st[r])
st[i] = st[r], first[i] = first[r], last[i] = last[r], gap[i] = gap[r];
else
st[i] = st[l], first[i] = first[l], last[i] = last[r], gap[i] = max(max(gap[l], gap[r]), first[r] - last[l]);
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |