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;
int main() {
int n,m;
cin >> n >> m;
vector<pair<int, int> >v;
vector<int> frame;
for (int i = 0; i < n; i++)
{
int value,size;
cin >> size >> value;
v.push_back(make_pair(value,size));
}
sort(v.begin(),v.end());
for (int i = 0; i < m; i++){
int sayi=0;
cin >> sayi;
frame.push_back(sayi);
}
sort(frame.begin(),frame.end());
int cevap=0;
int indis=frame.size()-1;
for (int i = n-1; i >= 0; i--)
{
if(v[i].second <=frame[indis]){
cevap++;
indis--;
}
}
cout << cevap;
}
/*
4 4
10 20
3 19
7 18
5 17
10
2
6
*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |