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 <algorithm>
using namespace std;
int32_t main() {
ios::sync_with_stdio(0); cin.tie(0);
int n, m; cin >> n >> m;
vector<pair<int, int>> a(n);
vector<int> b(m);
for (int i = 0; i < n; i++) {
cin >> a[i].second >> a[i].first;
}
for (int i = 0; i < m; i++) {
cin >> b[i];
}
sort(a.rbegin(), a.rend());
sort(b.rbegin(), b.rend());
int i = 0;
for (auto [x, y] : a) {
if (i < m && y <= b[i]) i++;
}
cout << i << '\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... |