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;
int n, m, b[100000];
array<int, 2> a[100000];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m;
for(int i = 0; i < n; i++)cin >> a[i][1] >> a[i][0];
for(int i = 0; i < m; i++) cin >> b[i];
sort(a, a + n); sort(b, b + m);
int ans = m - 1;
for(int i = n - 1; i >= 0; i++) if(ans >= 0 && a[i][1] <= b[ans]) ans--;
cout << m - 1 - ans << '\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... |