# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
582953 | elkernos | Constellation 3 (JOI20_constellation3) | C++17 | 403 ms | 66720 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;
const int oo = 1000 * 1000 * 1000;
struct Tree {
typedef pair<int, int> T;
static constexpr T unit = {-oo, -oo};
T f(T a, T b) { return max(a, b); }
vector<T> s;
int n;
Tree(int nn) : s(2 * nn), n(nn) {}
void update(int pos, T val)
{
for(s[pos += n] = val; pos /= 2;) {
s[pos] = f(s[pos * 2], s[pos * 2 + 1]);
}
}
T query(int b, int e)
{
T ra = unit, rb = unit;
for(b += n, e += n + 1; b < e; b /= 2, e /= 2) {
if(b % 2) ra = f(ra, s[b++]);
if(e % 2) rb = f(s[--e], rb);
}
return f(ra, rb);
}
};
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |