# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
216901 | rama_pang | Harvest (JOI20_harvest) | C++14 | 766 ms | 95780 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;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
long long floor_div(long long a, long long b) { // integer floor division
return (a / b) - ((a ^ b) < 0 && a % b);
}
namespace Treap {
struct TreapNode {
int prior, sz;
long long value, lazy = 0;
TreapNode *l, *r;
TreapNode(long long v = 0) : prior(rnd()), sz(1), value(v), l(NULL), r(NULL) {}
};
using pt = TreapNode*;
int sz(pt t) { return t ? t->sz : 0; }
void upd(pt t) { if (t) t->sz = sz(t->l) + sz(t->r) + 1; }
void apply(pt t, long long x) { if (t) t->value += x, t->lazy += x; }
void push(pt t) {
if (!t) return;
apply(t->l, t->lazy);
apply(t->r, t->lazy);
t->lazy = 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |