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>
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#define ii pair<int,int>
using namespace std;
int n,m,v,s;
vector<ii> r;
vector<int> c;
signed main(){
// freopen(".inp","r",stdin);
// freopen(".out","w",stdout);
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin>>n>>m;
for(int i=0;i<n;i++){
cin>>s>>v;
r.push_back({v,s});
}
for(int i=0;i<m;i++){
cin>>s;
c.push_back(s);
}
sort(r.begin(),r.end());
sort(c.begin(),c.end());
int lst=m-1;
for(int i=n-1;i>=0;i--){
if(r[i].second<=c[lst]) lst--;
if(lst<0) break;
}
cout<<m-lst-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... |