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;
int c[100005];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int N,M;
cin>>N>>M;
vector<pair<int,int>>v;
for(int i=0;i<N;i++){
int S,V;
cin>>S>>V;
v.push_back({V,S});
}
for(int i=0;i<M;i++){
cin>>c[i];
}
sort(v.begin(),v.end());
sort(c,c+M);
int ans=0;
for(int i=N-1;i>=0;i--){
if(c[M-ans-1]>=v[i].second){
ans++;
}
if(ans==M) break;
}
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... |