# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1057600 | sammyuri | Gift Exchange (JOI24_ho_t4) | C++17 | 1555 ms | 64180 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;
/*
for each index, calculate val[i],
the minimum index j > i such that they intersect
note that it is valid iff for all l, l + 1, .. , r - 1
val[i] <= r
so use a max segtree?
for each index, calculate closest left and right that is required
then we get an invalid range L..R
so we have n invalid ranges
and for each query, we want to find if it is contained in any of these ranges
go from left to right
and do sweep line
maintain it with multiset
3 events
*/
const int MAXN = (1 << 20);
int LEFT[MAXN], RIGHT[MAXN];
int tree[2 * MAXN];
int lazy[2 * MAXN];
void init() {
for (int i = 0; i < MAXN * 2; i ++)
tree[i] = 1e9, lazy[i] = 1e9;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |