#include<bits/stdc++.h>
using namespace std;
const int mx=1002;
typedef long long ll;
int inf=1e9+10;
const int mod=1e9+7;
int n,m;
vector<pair<int,int>>v;
vector<int>f;
int main(){
/* f.push_back(5); f.push_back(8);
auto it=lower_bound(f.begin(),f.end(),9)-f.begin();
cout<<it;
*/
cin>>n>>m;
int s[n];
int vv[n];
for(int i=0;i<n;i++){
cin>>s[i]>>vv[i];
v.push_back({vv[i],s[i]});
}
sort(v.begin(),v.end());
for(int i=0;i<m;i++){
int x;cin>>x;
f.push_back(x);
}
sort(f.begin(),f.end());
int l=m-1;
int ans=0;
for(int j=n-1;j>=0;j--){
if(v[j].second<f[l]){
ans++;
l--;
}
}
cout<< ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |