# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
707062 | lam | Progression (NOI20_progression) | C++14 | 1500 ms | 119488 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>
#define int long long
using namespace std;
const int inf = (int)1e18;
const int maxn = 3e5 + 10;
int n,m;
int D[maxn];
struct node
{
int pre,suf,val_l,val_r,sz,ans;
};
node hop(node x, node y)
{
if (x.val_l==-1e18) return y;
if (y.val_l==-1e18) return x;
node cur;
cur.sz=x.sz+y.sz;
cur.ans=max(x.ans,y.ans);
if (x.val_r==y.val_l) cur.ans=max(cur.ans,x.suf+y.pre);
cur.val_l=x.val_l; cur.val_r=y.val_r;
cur.pre = x.pre;
if (x.sz==x.pre&&x.val_r==y.val_l) cur.pre=max(cur.pre,x.sz+y.pre);
else cur.pre=x.pre;
cur.suf = y.suf;
if (y.sz==y.suf&&x.val_r==y.val_l) cur.suf=max(cur.suf,y.sz+x.suf);
return cur;
}
node none = {0,0,-inf,-inf,0,0};
struct segtree
{
# | 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... |