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 ll long long
#define ff first
#define ss second
#define db double
using namespace std;
int n,m;
pair<int,int> a[100001];
int b[100001];
int main(){
cin>>n>>m;
for(int k=1;k<=n;k++){
cin>>a[k].ss>>a[k].ff;
}
sort(a+1,a+n+1);
for(int k=1;k<=m;k++){
cin>>b[k];
}
sort(b+1,b+m+1);
int bolo=m;
int cnt=0;
for(int k=n;k>=1;k--){
if(a[k].ss<=b[bolo]){
cnt++;
bolo--;
}
}
cout<<cnt;
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... |