# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1113135 | ttamx | Growing Vegetables is Fun 5 (JOI24_vegetables5) | C++17 | 5044 ms | 69304 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;
const int N=3e5+5;
const int K=1<<21;
const int INF=INT_MAX/2;
int n;
int a[3*N],b[N],c[N];
int pos[3*N];
int l[3*N],r[3*N];
bool d1[3*N],d2[3*N];
struct Info{
int sum,pre,suf,mx;
friend Info operator+(const Info &l,const Info &r){
return {l.sum+r.sum,max(l.pre,l.sum+r.pre),max(r.suf,r.sum+l.suf),max({l.mx,r.mx,l.suf+r.pre})};
}
};
struct SegTree{
Info t[K];
void build(int l,int r,int i){
t[i]={0,-INF,-INF,-INF};
if(l==r)return;
int m=(l+r)/2;
build(l,m,i*2);
build(m+1,r,i*2+1);
}
# | 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... |