| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 391333 | timmyfeng | Exhibition (JOI19_ho_t2) | C++17 | 1 ms | 332 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 N = 100000;
array<int, 2> pics[N];
int frames[N], lis[N];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
for (int i = 0; i < n; ++i) {
auto &[s, v] = pics[i];
cin >> s >> v;
}
sort(pics, pics + n);
for (int i = 0; i < m; ++i) {
cin >> frames[i];
}
sort(frames, frames + m);
int low = 0, high = m;
while (low < high) {
int mid = (low + high + 1) / 2;
fill(lis, lis + mid, INT_MAX);
for (int i = 0; i < n; ++i) {
auto [s, v] = pics[i];
int j = upper_bound(lis, lis + mid, v) - lis;
if (j < mid && s <= frames[m - mid + j]) {
lis[j] = v;
}
}
if (lis[mid - 1] < INT_MAX) {
low = mid;
} else {
high = mid - 1;
}
}
cout << high << "\n";
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
