#include <bits/stdc++.h>
using namespace std;
pair <int , int> candidat[100001];
int sir[100001];
int main ()
{
ios :: sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int candidati , cantitate;
cin >> candidati >> cantitate;
for (int indice = 1 ; indice <= candidati ; indice++)
{ cin >> candidat[indice].second >> candidat[indice].first; }
for (int indice = 1 ; indice <= cantitate ; indice++)
{ cin >> sir[indice]; }
sort(candidat + 1 , candidat + candidati + 1);
sort(sir + 1 , sir + cantitate + 1);
int maxim = 0;
for (int indice = cantitate , __indice = candidati ; indice && __indice ; __indice--) {
if (sir[indice] >= candidat[__indice].second)
{ maxim++; indice--; }
}
cout << maxim;
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... |