# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
761489 | raysh07 | Sequence (APIO23_sequence) | C++17 | 2075 ms | 56260 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;
struct Node{
int prefmx, prefmn, sufmx, sufmn, tot, val;
};
const int N = 5e5 + 69;
Node seg[4 * N];
Node res;
int n;
Node combine(Node a, Node b){
Node ok;
ok.tot = a.tot + b.tot;
ok.prefmx = max(a.prefmx, b.prefmx + a.tot);
ok.prefmn = min(a.prefmn, b.prefmn + a.tot);
ok.sufmx = max(b.sufmx, a.sufmx + b.tot);
ok.sufmn = min(b.sufmn, a.sufmn + b.tot);
ok.val = a.val + b.val;
return ok;
}
void upd(int l, int r, int pos, int qp, int v){
if (l == r){
seg[pos].tot = v;
seg[pos].prefmx = max(v, 0);
seg[pos].prefmn = min(v, 0);
seg[pos].sufmx = max(v, 0);
seg[pos].sufmn = min(v, 0);
# | 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... |