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>
#define xx first
#define yy second
#define maxn 100005
using namespace std;
typedef pair<int,int> pii;
int n,m;
pii niz[maxn];
int ram[maxn];
int main()
{
ios_base::sync_with_stdio(false);
cin >> n >> m;
for(int i=0; i<n; i++)cin >> niz[i].yy >> niz[i].xx;
sort(niz, niz + n);
for(int i=0; i<m; i++)cin >> ram[i];
sort(ram, ram + m);
int br = m-1;
int br2 = n-1;
int res = 0;
while(br >= 0 && br2 >= 0){
if(ram[br] >= niz[br2].yy){
br--;
res++;
}
br2--;
}
cout << res << 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... |