# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
492772 | keta_tsimakuridze | Distributing Candies (IOI21_candies) | C++17 | 2655 ms | 50396 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>
#define pii pair<int,int>
#define f first
#define s second
#include "candies.h"
using namespace std;
const int N = 2e5 + 5;
long long lazy[4 * N];
struct node {
long long mx, mn, id1, id2, sum;
} tree[4 * N], Z;
node merge(node a, node b) {
node c = {0,0,0,0, 0};
if(a.mx > b.mx) c.mx = a.mx, c.id1 = a.id1;
else c.mx = b.mx, c.id1 = b.id1;
if(a.mn < b.mn) c.mn = a.mn, c.id2 = a.id2;
else c.mn = b.mn, c.id2 = b.id2;
c.sum = 0;
return c;
}
void build(int u,int l,int r) {
if(l == r) {
tree[u].id1 = tree[u].id2 = l;
return;
}
int mid = (l + r)/2;
build(2 * u, l, mid); build(2 * u + 1,mid + 1,r);
tree[u] = merge(tree[2 * u], tree[2 * u + 1]);
}
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... |