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 <iostream>
#include <algorithm>
using namespace std;
int main(){
int n,m; cin >> n >> m;
pair<int, int> paint[n];
int frame[m];
for(int i =0; i <n;i++){
cin >> paint[i].second >> paint[i].first;
}
for(int i = 0; i <m;i++){
cin >> frame[i];
}
sort(paint, paint+n);
sort(frame, frame+m);
int paint_i = n-1;
int answer = 0;
for(int i = m-1; i>=0;i--){
int size = frame[i];
while(paint_i >=0 && paint[paint_i].second > size){
paint_i--;
}
if(paint_i<0){
cout << answer <<'\n';
return 0;
}
paint_i-=1;
answer +=1;
}
cout << answer <<'\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... |