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> > slika(n);
vector<int> ramka(m);
for (int i=0;i<n;i++)
cin >> slika[i].second >> slika[i].first;
for (int i=0;i<m;i++)
cin >> ramka[i];
sort(slika.begin(),slika.end());
sort(ramka.begin(),ramka.end());
int index=n-1,vk=0;
for (int i=m-1;i>=0;)
{
if (index==-1) break;
if (ramka[i]<slika[index].second) index--;
else i--,index--,vk++;
}
cout << vk << endl;
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... |