显示代码纯文本
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
// 用cena记得用I64d!!!
const int INF = 0x3f3f3f3f;
int n,m;
int a[2000+10],b[2000+10];
bool vis[2000+10];
int main()
{
freopen("applea.in","r",stdin);freopen("applea.out","w",stdout);
cin>>n>>m;
for(int i = 1;i <= n; i++)
cin>>a[i];
for(int i = 1;i <= m;i ++)
cin>>b[i];
sort(b + 1,b + 1 + m);
int tem = 0;
for(int i = 1 ;i <= n;i ++)
{
for(int j = m; j >= 1; j--)
{
if(b[j] <= 0) vis[j] = true;
if(!vis[j] && a[i] > b[j])
{
tem ++;
vis[j] = true;
break;
}
}
}
cout<<m - tem;
return 0;
}