# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
559842 | thecodingwizard | Sjeckanje (COCI21_sjeckanje) | C++11 | 929 ms | 36284 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;
using ll = long long;
const ll inf = (1LL << 59);
int n, q;
vector<ll> A;
const int maxst = 800000;
// 0 = increasing, 1 = decreasing
ll lhs[maxst], rhs[maxst], val[maxst][2][2];
void merge(int p, int i, int j) {
lhs[p] = lhs[p*2];
rhs[p] = rhs[p*2+1];
// two separate things
for (int a = 0; a < 2; a++) {
for (int b = 0; b < 2; b++) {
val[p][a][b] = 0;
for (int c = 0; c < 2; c++) {
for (int d = 0; d < 2; d++) {
val[p][a][b] = max(val[p][a][b], val[p*2][a][c] + val[p*2+1][d][b]);
}
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |