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;
vector<int>r;
vector<pair<int,int>>v1;
int main(){
int n,m,s,v,x;
cin>>n>>m;
for(int i=0;i<n;i++){
cin>>s>>v;
v1.push_back(make_pair(v,s));
}
for(int i=0;i<m;i++){
cin>>x;
r.push_back(x);
}
sort(v1.begin(),v1.end());
sort(r.begin(),r.end());
int ans=m-1;
for(int i=n-1;i>=0;i--){
if(v1[i].second<=r[ans]) ans--;
if(ans<0) break;
}
cout<<m-ans-1;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |