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 pii pair<int,int>
pii pic[100003];
int fra[100003];
void init(int &n, int &m){
cin >> n >> m;
for (int i = 1; i<=n; i++){
cin >> pic[i].second >> pic[i].first;
}
for (int i = 1; i<=m; i++){
cin >> fra[i];
}
sort(pic+1,pic+n+1);
sort(fra+1,fra+n+1);
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n,m;
init(n,m);
int ans=0,frames=m;
for (int i = n; i>=1; i--){
if (frames>0 && fra[frames]>=pic[i].second){
frames--;
ans++;
}
}
cout << ans << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |