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 int long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define ff first
#define ss second
using namespace std;
const int N=2*1e5;
int n,m,k,i,j,ans;
signed main() {
cin>>n>>m;
vector<int> a(m);
vector<pii> p(n);
for(int k=0; k<n; k++){
int x,y;
cin>>x>>y;
p[k]={y,x};
}
for(int k=0; k<m; k++){
int x;
cin>>x;
a[k]=x;
}
sort(p.rbegin(),p.rend());
sort(a.rbegin(),a.rend());
ans=0;
for(int k=0; k<n; k++){
if(p[k].ss<=a[ans])ans++;
}
cout<<ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |