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 ll long long
#define endl "\n"
#define all(aa) aa.begin(), aa.end()
int main(){
int n, m;
cin>>n>>m;
vector<pair<int, int>> a(n);
vector<int> b(m);
for(auto &[v, s]:a) cin>>s>>v;
for(auto &e:b) cin>>e;
sort(all(a)); sort(all(b));
int ans=0, i=n-1, j=m-1;
while(i>=0){
if(a[i].second<=b[j]) ans++, j--;
i--;
}
cout<<ans<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |