# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
585253 | keta_tsimakuridze | Progression (NOI20_progression) | C++14 | 553 ms | 85784 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, inf = 2e18; //!
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[N];
bool eq(int a, int b) {
return (a == -inf || b == -inf ? 1 : a == b);
}
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);
// cout << eq(a.suf.f, b.suf.f) << endl;
if(eq(a.suf.f, b.pref.f) && eq(a.suf.f, b.L - a.R) && eq(b.pref.f, b.L - a.R)) {
c.ans = max(c.ans, a.suf.s + b.pref.s);
}
if(eq(a.suf.f, b.L - a.R)) {
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... |