#C5541. Minimum Rounds to Solve Problems
Minimum Rounds to Solve Problems
Minimum Rounds to Solve Problems
You are given a list of integers representing the difficulty levels of a series of problems. You must solve these problems in rounds. In each round, you can solve a contiguous sequence of problems as long as their difficulties are in non-decreasing order.
If you encounter a problem with a difficulty level lower than the previous one, you must start a new round. Formally, for a list of difficulties \(a_1, a_2, \dots, a_n\), you start a new round every time \(a_i < a_{i-1}\) for \(2 \leq i \leq n\).
Your task is to determine the minimum number of rounds required to solve all the problems.
inputFormat
The input is read from stdin and is formatted as follows:
- The first line contains an integer \(n\) — the number of problems.
- The second line contains \(n\) space-separated integers representing the difficulty levels of the problems.
outputFormat
Output a single integer to stdout — the minimum number of rounds required to solve all the problems.
## sample1
1
1