#include<bits/stdc++.h>
#define F first
#define S second
#define MAX 500005
#define oo 1e18
#define mod 1000000007
#define fast_in ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);cout.setf(ios::fixed);cout.precision(0);
using namespace std;
typedef long long ll;
#define pll pair<ll , ll>
#define vll vector<ll>
#define vvll vector<vll>
#define vpll vector<pll>
ll t,n,b[MAX],m;
pll a[MAX];
int main(){
fast_in
cin>>n>>m;
for(int i=0;i<n;i++){
cin>>a[i].S>>a[i].F;
}sort(a,a+n);
for(int i=0;i<n;i++){
cin>>b[i];
}sort(b,b+m);
ll h=m-1,r=0;
for(int i=n;i>=0;i--){
if(b[h]>=a[i].S){
r++;h--;
if(h==-1)break;
}
}
cout<<r<<"\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |