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 <algorithm>
#include <vector>
#define fs first
#define se second
using namespace std;
typedef pair<int, int> pii;
int n, m;
pii ps[100000];
int cs[100000];
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n >> m;
for (int i = 0; i < n; ++i) cin >> ps[i].se >> ps[i].fs;
for (int i = 0; i < m; ++i) cin >> cs[i];
sort(ps, ps + n);
sort(cs, cs + m);
for (int i = m, j = n; i--; ) {
while (j > 0 && cs[i] < ps[j - 1].se) --j;
if (j-- == 0) {
printf("%d\n", m - i - 1);
return 0;
}
}
printf("%d\n", m);
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... |