You are given two arrays of integers a and b. For each element of the second array bj you should find the number of elements in array athat are less than or equal to the value bj.
Input
The first line contains two integers n, m (1 ≤ n, m ≤ 2·105) — the sizes of arrays a and b.
The second line contains n integers — the elements of array a ( - 109 ≤ ai ≤ 109).
The third line contains m integers — the elements of array b ( - 109 ≤ bj ≤ 109).
Output
Print m integers, separated by spaces: the j-th of which is equal to the number of such elements in array a that are less than or equal to the value

这道题目要求根据两个整数数组a和b,计算数组a中每个元素小于或等于b中对应元素的数量。输入包含两个数组的大小和元素,输出是对应计数结果。题目示例展示了如何处理这种问题。这是一个简单的STL应用题。
最低0.47元/天 解锁文章
334

被折叠的 条评论
为什么被折叠?



