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 <vector>
#include <algorithm>
using namespace std;
int main(){
long long int n,m,sol=0,cont=0;
cin>>n>>m;
vector<pair<int,int> >v(n);
vector<int> frame(m);
for(int i=0;i<n;i++)cin>>v[i].second>>v[i].first;
for(int i=0;i<m;i++)cin>>frame[i];
sort(v.rbegin(),v.rend());
sort(frame.rbegin(),frame.rend());
for(int i=0;i<m;i++){
while(v[cont].second>frame[i]){
cont++;
if(cont==n)break;
}
if(cont==n)break;
sol++;
cont++;
if(cont==n)break;
}
cout<<sol;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |