# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
774008 | SanguineChameleon | Distributing Candies (IOI21_candies) | C++17 | 702 ms | 44576 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;
const int inf = 1e9 + 20;
const int maxN = 2e5 + 20;
vector<pair<int, int>> events[maxN];
struct node {
long long mx, mi, lazy;
node(): mx(0), mi(0), lazy(0) {};
node(long long _mx, long long _mi): mx(_mx), mi(_mi), lazy(0) {};
};
node tree[maxN * 4];
node merge(node left, node right) {
return node(max(left.mx, right.mx), min(left.mi, right.mi));
}
void add(int id, long long val) {
tree[id].mx += val;
tree[id].mi += val;
tree[id].lazy += val;
}
void push(int id) {
add(id * 2, tree[id].lazy);
# | 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... |