#include <bits/stdc++.h>
#define ll long long
#define f first
#define s second
const int N=1e5+10;
using namespace std;
int n,m,sz[N];
pair<int,int>a[N];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin>>n>>m;
for(int i=1; i<=n; i++) cin>>a[i].s>>a[i].f;
for(int i=1; i<=m; i++) cin>>sz[i];
sort(a+1,a+n+1);
sort(sz+1,sz+m+1,greater<int>());
int run=n,kq=0;
for(int i=1; i<=m; i++)
{
while(run>0&&a[run].s>sz[i]) run--;
if(!run) return cout<<kq,0;
run--;
kq++;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |