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>
using namespace std;
int main(){
cin.tie(0)->sync_with_stdio(0);
int n, m; cin >> n >> m;
pair<int, int> a[n];
for (int i = 0; i < n; i++){
cin >> a[i].second >> a[i].first;
}
sort(a, a + n, greater<pair<int, int>>());
int b[m];
for (int i = 0; i < m; i++){
cin >> b[i];
}
sort(b, b + m, greater<int>());
int i = 0, j = 0;
while (i < n && j < m){
if (a[i].second <= b[j]){
i++, j++;
}else{
i++;
}
}
cout << j;
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... |