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 main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n,m;
cin>>n>>m;
vector<pair<int,int>>alla(n);
vector<int>allb(m);
for(int i=0;i<n;i++){
cin>>alla[i].second>>alla[i].first;
}
for(int i=0;i<m;i++){
cin>>allb[i];
}
sort(alla.begin(),alla.end());
sort(allb.begin(),allb.end());
int res=0,last=m-1;
for(int i=n-1;i>=0;i--){
if(last>=0&&alla[i].second<=allb[last]){
res++;
last--;
}
}
cout<<res<<"\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |