记录编号 |
444662 |
评测结果 |
AAAAAAAAAA |
题目名称 |
[Vijos 1291] 苹果摘陶陶 |
最终得分 |
100 |
用户昵称 |
HeHe |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.007 s |
提交时间 |
2017-09-03 18:45:15 |
内存使用 |
0.58 MiB |
显示代码纯文本
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
inline char getc(void) {
static char buf[1 << 18], *fs, *ft;
return (fs == ft && (ft = (fs = buf) + fread(buf, 1, 1 << 18, stdin)), fs == ft) ? EOF : *fs++;
}
inline int read(void) {
register int res = 0;
register char tmp = getc(), f = 1;
while(!isgraph(tmp)) tmp = getc();
if(tmp == '-') f = -1, tmp = getc();
while(isdigit(tmp))
res = ((res + (res << 2)) << 1) + (tmp ^ 0x30),
tmp = getc();
return res * f;
}
#define MAXN (2010)
int N, M, cnt;
int s1[MAXN], s2[MAXN];
int main() {
#ifndef LOCAL
freopen("applea.in", "r", stdin);
freopen("applea.out", "w", stdout);
#endif
N = read(), M = read();
for(int i = 0, *j = s1; i < N; ++i) *j++ = read();
for(int i = 0, *j = s2; i < M; ++i) *j++ = read();
sort(s1, s1 + N, greater<int>());
sort(s2, s2 + M, greater<int>());
int i = 0, j = 0;
while(i < N && j < M && s2[j] > 0)
if(s1[i] > s2[j]) ++cnt, ++i, ++j;
else ++j;
printf("%d", M - cnt);
return 0;
}