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;
#define fi first
#define se second
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int n,m;
cin>>n>>m;
pair<int,int> vs[n+5];
for(int i=1; i<=n; i++) cin>>vs[i].se>>vs[i].fi;
sort(vs+1,vs+n+1);
int c[m+5];
for(int i=1; i<=m; i++) cin>>c[i];
sort(c+1,c+m+1);
int t = m+1; //last taken
for(int i=n; i>=1; i--){
if(t==1) break;
if(c[t-1] >= vs[i].se) t--;
}
cout<<(m+1-t);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |