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 ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define ff first
#define ss second
using namespace std;
int n,m,k,i,j,ans,a[200005];
pii p[200005];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
cin>>n>>m;
for(k=1; k<=n; k++)cin>>p[k].ss>>p[k].ff;
for(k=1; k<=m; k++)cin>>a[k];
sort(p+1,p+1+n);
sort(a+1,a+m+1);
int pos=m;
for(k=n; k>0; k--){
if(p[k].ss<=a[pos])pos--;
}
ans=m-pos;
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... |