Counting 2

AtCoder
IDabc231_c
Time2000ms
Memory256MB
Difficulty
There is a class with $N$ students. The height of the $i$\-th student $(1 \leq i \leq N)$ is $A_i$. For each $j=1,2,\ldots,Q$, answer the following question. * How many of the $N$ students have a height of at least $x_j$? ## Constraints * $1 \leq N,Q \leq 2 \times 10^5$ * $1 \leq A_i \leq 10^9$ * $1 \leq x_j \leq 10^9$ * All values in input are integers. ## Input Input is given from Standard Input in the following format: $N$ $Q$ $A_1$ $A_2$ $\ldots$ $A_N$ $x_1$ $x_2$ $\vdots$ $x_Q$ [samples]
Samples
Input #1
3 1
100 160 130
120
Output #1
2

The students with a height of at least $120$ are the $2$\-nd and $3$\-rd ones.
Input #2
5 5
1 2 3 4 5
6
5
4
3
2
Output #2
0
1
2
3
4
Input #3
5 5
804289384 846930887 681692778 714636916 957747794
424238336
719885387
649760493
596516650
189641422
Output #3
5
3
5
5
5
API Response (JSON)
{
  "problem": {
    "name": "Counting 2",
    "description": {
      "content": "There is a class with $N$ students. The height of the $i$\\-th student $(1 \\leq i \\leq N)$ is $A_i$. For each $j=1,2,\\ldots,Q$, answer the following question. *   How many of the $N$ students have a h",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc231_c"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "There is a class with $N$ students. The height of the $i$\\-th student $(1 \\leq i \\leq N)$ is $A_i$.\nFor each $j=1,2,\\ldots,Q$, answer the following question.\n\n*   How many of the $N$ students have a h...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments