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;
#define int long long
#define ll long long
pair<int,int> a[111111];
int b[111111];
//int fra[111111];
signed main()
{
int n,m;cin>>n>>m;
for(int i = 1; i <= n; i++) cin >> a[i].second >> a[i].first;
for(int i = 1; i <= m; i++) cin >> b[i];
sort(b+1, b+1 + m);
sort(a+1, a+1 + n);
ll x = m;
ll ans = 0;
for(int i = n; i > 0&&x; i--){
if(b[x] >= a[i].second){
x--;
ans++;
}
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |