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>
using namespace std;
vector<pair<int, int>> v;
vector<int> sz;
int main() {
int n, m;
cin >> n >> m;
v.resize(n + 1);
sz.resize(m + 1);
for(int i = 1; i <= n; i ++) {
cin >> v[i].second >> v[i].first;
}
sort(v.begin() + 1, v.end());
for(int i = 1; i <= m; i ++) {
cin >> sz[i];
}
sort(sz.begin() + 1, sz.end());
int cnt = 0;
for(int i = n; i >= 1 && cnt < m; i --) {
if(sz[m - cnt] >= v[i].second) {
cnt ++;
}
}
cout << cnt;
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... |