# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1017521 | BestCrazyNoob | Rectangles (IOI19_rect) | C++17 | 3444 ms | 419044 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 "rect.h"
#include <utility>
#include <tuple>
#include <vector>
#include <functional>
#include <algorithm>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
constexpr int MAXN = 2'500;
int N, M;
struct SegTreeMax {
int sz;
vector<pii> tree; // min, index (min(a, b) works)
int ql, qr;
void merge(int i) {
tree[i] = max(tree[2*i], tree[2*i+1]);
}
SegTreeMax(vector<int> V) {
sz = 1;
while (sz < V.size()) sz *= 2;
tree.resize(2*sz);
for (int i = 0; i < V.size(); i++) tree[sz+i] = {V[i], i};
for (int i = V.size(); i < sz; i++) tree[sz+i] = {-1, -1};
for (int i = sz-1; i >= 1; i--) merge(i);
}
pii __query(int ni, int nl, int nr) {
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |