# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
621511 | resting | Distributing Candies (IOI21_candies) | C++17 | 549 ms | 69620 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 "candies.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 0x7FFFFFFF
#define ff first
#define ss second
struct info {
ll mn, mx, sm, mnp, mxp;
info() : mn(inf), mx(-inf), sm(0), mnp(-1), mxp(-1){};
info(ll p) : mn(inf), mx(-inf), sm(0), mnp(p), mxp(p){};
info(ll v, ll p) : mn(v), mx(v), sm(v), mnp(p), mxp(p){};
};
struct node {
ll l, r; // mleft, right
info d;
node() : node(-1, -1){};
node(ll l, ll r) : l(l), r(r){};
};
struct st {
vector<node> t;
const ll n;
st(ll n) : t(n * 4), n(n) { build(0, n - 1, 0); }
void build(ll l, ll r, ll x) {
t[x] = node(l, r);
if (l == r) t[x].d = info(l);
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |