# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
707040 | lam | Progression (NOI20_progression) | C++14 | 1465 ms | 127968 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 maxn = 3e5 + 10;
typedef pair<int,int> ii;
#define ff first
#define ss second
int n,m;
int D[maxn];
struct node
{
int pre,suf,val_l,val_r,ans,sz;
};
inline node hop(node x, node y)
{
if (x.val_l==-1e18) return y;
if (y.val_l==-1e18) return x;
node z;
z.pre = x.pre;
if (x.pre==x.sz&&x.val_r==y.val_l) z.pre = max(z.pre,x.sz+y.pre);
z.suf = y.suf;
if (y.suf==y.sz&&y.val_l==x.val_r) z.suf = max(z.suf,y.sz+x.suf);
z.val_l = x.val_l; z.val_r = y.val_r;
z.ans = max(x.ans, y.ans);
if (x.val_r==y.val_l) z.ans = max(z.ans,x.suf+y.pre);
z.sz = x.sz + y.sz;
return z;
}
Compilation message (stderr)
# | 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... |