# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
531847 | kazak | Distributing Candies (IOI21_candies) | C++17 | 1251 ms | 53316 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;
#define all(x) (x).begin(), (x).end()
#define forn(i, x, y) for(int i = (x); i < (y); i++)
//#pragma GCC optimize ("Ofast")
//#pragma GCC optimize ("unroll-loops")
#define int long long
#define double long double
const int maxn = 2e5 + 5, inf = 1e18;
struct node {
int sum, mx, mn;
node(): sum(0), mx(-0), mn(0) {}
node(int x): sum(x), mx(max(0ll, x)), mn(min(0ll, x)) {}
} d[maxn * 4];
node merge(node a, node b) {
node res;
res.sum = a.sum + b.sum;
res.mx = max(a.mx, b.mx + a.sum);
res.mn = min(a.mn, b.mn + a.sum);
return res;
}
void change(int v, int tl, int tr, int idx, int val) {
if(tl == tr) {
d[v] = node(val);
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... |