1571 人解决,1771 人已尝试。
1876 份提交通过,共有 5095 份提交。
0.9 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
There is a database,partychen want you to sort the database’s data in the order from the least up to the greatest element,then do the query: “Which element is i-th by its value?”- with i being a natural number in a range from 1 to N.
It should be able to process quickly queries like this.
The standard input of the problem consists of two parts. At first, a database is written, and then there’s a sequence of queries. The format of database is very simple: in the first line there’s a number
The output should consist of K lines. In each line there should be an answer to the corresponding query. The answer to the query “i” is an element from the database, which is i-th by its value (in the order from the least up to the greatest element).
5 7 121 123 7 121 3 3 2 5
121 7 123
Hint
After we sort the data we get 7 7 121 121 123,so the postion 3 is 121,the postion 2 is 7 and the position 5 is 123 etc.
1571 人解决,1771 人已尝试。
1876 份提交通过,共有 5095 份提交。
0.9 EMB 奖励。