#include <bits/stdc++.h>
#define MAXN 100007
using namespace std;
pair<int,int> a[MAXN];
int b[MAXN];
int main()
{
int n,m;
cin>>n>>m;
for(int i=0;i<n;i++) cin>>a[i].second>>a[i].first;
for(int i=0;i<m;i++) cin>>b[i];
sort(a,a+n);
sort(b,b+m);
int x=n-1,y=m-1,ans=0;
while(x>=0 && y>=0)
{
if(b[y]>=a[x].first)
{
y--;
ans++;
}
x--;
}
cout<<ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
300 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
300 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
300 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |