# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
929787 | Pannda | Event Hopping 2 (JOI21_event2) | C++17 | 149 ms | 48452 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 INF = 1e9 + 12345;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, k;
cin >> n >> k;
vector<array<int, 2>> a(n);
for (int i = 0; i < n; i++) {
int l, r;
cin >> l >> r;
a[i] = {l, r};
}
auto [next, prev] = [](int n, vector<array<int, 2>> a) {
int log = 32 - __builtin_clz(n);
vector<vector<int>> next(n, vector<int>(log, -1));
vector<vector<int>> prev(n, vector<int>(log, -1));
vector<array<int, 3>> events;
for (int i = 0; i < n; i++) {
events.push_back({ a[i][0], +1, i });
events.push_back({ a[i][1], -1, i });
}
sort(events.begin(), events.end());
priority_queue<array<int, 2>, vector<array<int, 2>>, less<>> mx_pq;
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... |