# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
585389 | keta_tsimakuridze | Progression (NOI20_progression) | C++14 | 926 ms | 108440 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 pii pair<int,int>
#define f first
#define s second
#define endl "\n"
const int N = 3e5 + 5, mod = 1e9 + 7; //!
int t, d[N], a[N];
struct node {
int L, R, len;
pii suf, pref;
int ans;
} tree[4 * N];
struct z {
int k, b, t;
} lazy[4 * N];
bool eq(pii a, pii b) {
return (min(a.s, b.s) == 1 ? 1 : a.f == b.f);
}
node merge(node a, node b) {
node c;
c.len = a.len + b.len;
c.L = a.L; c.R = b.R;
c.ans = max(a.ans, b.ans);
c.pref = a.pref; c.suf = b.suf;
int d = b.L - a.R;
if(eq(a.suf, {d, 2})) {
c.ans = max(c.ans, a.suf.s + (!eq({d, 2}, b.pref) ? 1 : b.pref.s));
}
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... |