Lower

AtCoder
IDabc139_c
Time2000ms
Memory256MB
Difficulty
There are $N$ squares arranged in a row from left to right. The height of the $i$\-th square from the left is $H_i$. You will land on a square of your choice, then repeat moving to the adjacent square **on the right** as long as the height of the next square is not greater than that of the current square. Find the maximum number of times you can move. ## Constraints * All values in input are integers. * $1 \leq N \leq 10^5$ * $1 \leq H_i \leq 10^9$ ## Input Input is given from Standard Input in the following format: $N$ $H_1$ $H_2$ $...$ $H_N$ [samples]
Samples
Input #1
5
10 4 8 7 3
Output #1
2

By landing on the third square from the left, you can move to the right twice.
Input #2
7
4 4 5 6 6 5 5
Output #2
3

By landing on the fourth square from the left, you can move to the right three times.
Input #3
4
1 2 3 4
Output #3
0
API Response (JSON)
{
  "problem": {
    "name": "Lower",
    "description": {
      "content": "There are $N$ squares arranged in a row from left to right. The height of the $i$\\-th square from the left is $H_i$. You will land on a square of your choice, then repeat moving to the adjacent square",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc139_c"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "There are $N$ squares arranged in a row from left to right.\nThe height of the $i$\\-th square from the left is $H_i$.\nYou will land on a square of your choice, then repeat moving to the adjacent square...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments