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>
#define f first
#define s second
using namespace std;
int main(){
int n,m;
cin>>n>>m;
vector<pair<int,int> > p(n);
vector<int> c(m);
for(auto &x:p)cin>>x.s>>x.f;
for(int &x:c)cin>>x;
sort(c.begin(),c.end(),greater<int>());
sort(p.begin(),p.end());
int j=0;
int sol=0;
for(int i=n-1;i>=0;i--){
if(j<m&&c[j]>=p[i].s)sol++,j++;
}
cout<<sol<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |