# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
810245 | acatmeowmeow | Sjeckanje (COCI21_sjeckanje) | C++11 | 15 ms | 37844 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
const int N = 2e5;
int n, q, arr[N + 5];
struct info {
int mx[2][2] = {}, first, last;
info operator+(info x) {
info ans;
ans.first = first, ans.last = x.last;
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
for (int k = 0; k < 2; k++) {
for (int l = 0; l < 2; l++) {
ans.mx[i][l] = max(ans.mx[i][l], mx[i][j] + x.mx[k][l] + (j == 1 && k == 1 ? abs(last - x.first) : 0));
}
}
}
}
return ans;
}
};
info tree[4*N + 5];
int lazy[4*N + 5];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |