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 <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <climits>
#include <deque>
using namespace std;
#define ll long long
ll n, m, x, y, ans;
int main() {
cin >> n >> m;
vector<pair<int, int> > arr(n);
vector<int> frames(m);
for (int i = 0; i < n; i++) {
cin >> x >> y;
arr[i].first = y;
arr[i].second = x;
}
for (int i = 0; i < m; i++) {
cin >> frames[i];
}
sort(arr.begin(), arr.end());
sort(frames.begin(), frames.end());
int cur = m - 1;
for (int i = n - 1; i >= 0; i--) {
if (arr[i].second <= frames[cur]) {
cur--;
ans++;
if (cur < 0) {
cout << ans;
return 0;
}
}
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |