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;
typedef pair<int, int> pii;
const int MAX = 1e5+10;
int n, m;
int C[MAX]; pii P[MAX];
int cnt[MAX];
int main(){
ios::sync_with_stdio(0); cin.tie(0);
cin>>n>>m;
for(int i=1; i<=n; i++) cin>>P[i].second>>P[i].first;
for(int i=1; i<=m; i++) cin>>C[i];
sort(C+1, C+m+1);
sort(P+1, P+n+1);
reverse(P+1, P+n+1);
reverse(C+1, C+m+1);
int frt = 0;
for(int i=1; i<=n; i++){
if(C[frt+1] >= P[i].second) frt++;
}
cout<<frt<<'\n';
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... |