# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
634715 | null_awe | Event Hopping (BOI22_events) | C++14 | 1413 ms | 120664 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 <iostream>
#include <vector>
#include <map>
#include <set>
#include <climits>
using namespace std;
#define pii pair<int, int>
vector<vector<int>> tl;
// Segtree operations for maintaining reachable left nodes:
void btl(int n) {
tl = vector<vector<int>>(2 * n, vector<int>(30));
for (int i = 0; i < n; ++i) for (int j = 0; j < 30; ++j) tl[i + n][j] = i;
for (int i = n - 1; i > 0; --i) for (int j = 0; j < 30; ++j) tl[i][j] = min(tl[2 * i][j], tl[2 * i + 1][j]);
}
void upd(int n, int p, int j, int v) { for (tl[p += n][j] = v; p > 1; p >>= 1) tl[p >> 1][j] = min(tl[p][j], tl[p ^ 1][j]); }
int qry(int n, int l, int r, int j) {
int ans = INT_MAX;
for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
if (l & 1) ans = min(ans, tl[l++][j]);
if (r & 1) ans = min(ans, tl[--r][j]);
}
return ans;
}
int main() {
# | 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... |