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;
using vi = vector<int>;
using ll = long long;
using pi = pair<int,int>;
#define ST first
#define ND second
#define PB push_back
const int nax = 100 * 1000 + 10;
int n, m;
int c[nax];
pi p[nax];
int check() {
int cur = m;
for(int i = n; i >= 1; --i) {
if(cur >= 1 && c[cur] >= p[i].ND) {
cur--;
}
}
return m - cur;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m;
for(int i = 1; i <= n; ++i) {
cin >> p[i].ND >> p[i].ST;
}
for(int i = 1; i <= m; ++i) {
cin >> c[i];
}
sort(p+1, p+n+1);
sort(c+1, c+m+1);
//int l = 0, r = min(n, m), mid;
//while(l <= r) {
// mid = (l + r) / 2;
//
//}
cout << check();
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |