ZipRecruiterOA #2
Maximum Fish Caught
估计简单可在线判题
考点(AI 标注)贪心调度模拟/实现
Every fish and every bait has a positive integer size. A bait must be strictly smaller than a fish to catch it; each bait can be used at most 3 times, and each fish can be caught at most once. Find the maximum number of fish that can be caught.
输入格式
The first line contains n m (1..100000); the second line contains n fish sizes, and the third line contains m bait sizes, all values in 1..10^9.
输出格式
Output the maximum number of fish caught.
样例 1
输入:
3 1
1 2 3
1
输出:
2
样例 2
输入:
4 2
2 3 4 5
1 2
输出:
4
样例 3
输入:
4 2
5 5 6 2
1 4
输出:
4