#include<bits/stdc++.h>
#define mp make_pair
using namespace std;
const int N=2e5+10;
pair<int,int> pic[N];
vector<int> arr;
int f[N];
//value size
int main(){
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>>f[i];
sort(f+1,f+m+1,greater<int>());
sort(pic+1,pic+n+1,greater<pair<int,int>>());
int cur=1,ans=0;
for(int i=1;i<=n;i++){
if(f[cur]>=pic[i].second){
ans++;
cur++;
}
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |