CF600B.Queries about less or equal elements

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given two arrays of integers aa and bb . For each element of the second array bjb_{j} you should find the number of elements in array aa that are less than or equal to the value bjb_{j} .

输入格式

The first line contains two integers n,mn,m ( 1<=n,m<=21051<=n,m<=2·10^{5} ) — the sizes of arrays aa and bb .

The second line contains nn integers — the elements of array aa ( 109<=ai<=109-10^{9}<=a_{i}<=10^{9} ).

The third line contains mm integers — the elements of array bb ( 109<=bj<=109-10^{9}<=b_{j}<=10^{9} ).

输出格式

Print mm integers, separated by spaces: the jj -th of which is equal to the number of such elements in array aa that are less than or equal to the value bjb_{j} .

输入输出样例

  • 输入#1

    5 4
    1 3 5 7 9
    6 4 2 8
    

    输出#1

    3 2 1 4
    
  • 输入#2

    5 5
    1 2 1 2 5
    3 1 4 1 5
    

    输出#2

    4 2 4 2 5
    
首页