# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
750038 | bachhoangxuan | Sequence (APIO23_sequence) | C++17 | 957 ms | 74704 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 "sequence.h"
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define piii pair<int,pii>
#define fi first
#define se second
struct rn{//range
int l=0,r=0;
friend rn operator+(rn a,rn b){
return {a.l+b.l,a.r+b.r};
}
};
struct node{
int sum=0;
rn p,s;
node(int x=0){
p.r=max(p.r,x);p.l=min(p.l,x);
s.r=max(s.r,x);s.l=min(s.l,x);
sum+=x;
}
friend node operator+(node a,node b){
node res;res.sum=a.sum+b.sum;
res.p.r=max(a.p.r,a.sum+b.p.r);
res.p.l=min(a.p.l,a.sum+b.p.l);
res.s.r=max(b.s.r,b.sum+a.s.r);
res.s.l=min(b.s.l,b.sum+a.s.l);
return res;
}
};
# | 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... |