# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
390299 | apostoldaniel854 | Food Court (JOI21_foodcourt) | C++14 | 613 ms | 66784 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;
using ll = long long;
#define dbg(x) cerr << #x << " " << x << "\n"
struct node_t {
ll sum_max;
ll sum;
};
class segtree {
public:
vector <node_t> seg;
int n;
segtree (int n) {
this->n = n;
seg.resize (1 + 4 * n);
}
node_t combine (node_t lnode, node_t rnode) {
return {
max (rnode.sum_max, rnode.sum + lnode.sum_max),
lnode.sum + rnode.sum
};
}
void update (int node, int lb, int rb, int pos, ll val) {
if (lb == rb) {
seg[node] = {max (0ll, val), val};
return;
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |