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 DIM = 100005;
int frm[DIM];
pair<int, int> pic[DIM];
int main(void) {
#ifdef HOME
freopen("exhibition.in", "r", stdin);
freopen("exhibition.out", "w", stdout);
#endif
int n, m; cin >> n >> m;
for (int i = 1; i <= n; ++i) {
cin >> pic[i].second >> pic[i].first; }
for (int i = 1; i <= m; ++i) {
cin >> frm[i]; }
sort(pic + 1, pic + n + 1);
sort(frm + 1, frm + m + 1);
int ans = 0;
for (int i = m, it = n; i >= 1; --i) {
while (it > 0 and frm[i] < pic[it].second) {
--it; }
if (!it) {
break; }
else {
++ans; --it; } }
cout << ans;
return 0; }
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |