# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
842202 | d4xn | Event Hopping (BOI22_events) | C++17 | 107 ms | 17156 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;
#define all(x) x.begin(), x.end()
#define tp3 tuple<int, int, int>
const int N = 1e5, L = 17;
int n, q, dp[L][N], ans[N];
pair<int, int> sg[N];
tp3 sgL[N], sgR[N];
signed main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
cin >> n >> q;
for (int i = 0; i < n; i++) {
int l, r;
cin >> l >> r;
sg[i] = make_pair(l, r);
sgL[i] = make_tuple(l, r, i);
sgR[i] = make_tuple(r, l, i);
}
sort(sgL, sgL+n);
sort(sgR, sgR+n);
int curr = 0;
int mx = -1;
int mxIdx = -1;
for (int i = 0; i < n; i++) {
# | 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... |