# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
676491 | penguin133 | Progression (NOI20_progression) | C++17 | 1270 ms | 88264 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;
#define int long long
#define pi pair<int, int>
#define pii pair<int, pi>
#define fi first
#define se second
int A[300005];
struct pain{
int val, pmax, smax, pref, suf, len, sm;
};
pain merge(pain l, pain r){
pain ans;
ans.val = max(l.val, r.val);
ans.len = l.len + r.len;
if(l.suf == r.pref)ans.val = max(ans.val, l.smax + r.pmax);
ans.suf = r.suf, ans.pref = l.pref;
ans.pmax = l.pmax, ans.smax = r.smax;
if(l.suf == r.suf && r.smax == r.len)ans.smax += l.smax;
if(l.pref == r.pref && l.pmax == l.len)ans.pmax += r.pmax;
ans.sm = l.sm + r.sm;
return ans;
}
struct node{
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... |