#K72982. Memory Usage Trend Analysis
Memory Usage Trend Analysis
Memory Usage Trend Analysis
You are given a sequence of integers representing the memory usage of a process over several days. Your task is to determine whether the memory usage trend is strictly increasing, strictly decreasing, or fluctuating. A strictly increasing trend means that each day's memory usage is greater than the previous day's usage. Similarly, a strictly decreasing trend means each day's memory usage is lower than the previous day's usage. If neither condition is met, the trend is considered fluctuating.
Note: For a sequence with a single day, consider the trend as increasing by default.
The problem can be formally defined as follows:
Given an array (a_1, a_2, \dots, a_n), output:
- \(\texttt{increasing}\)
- \(\texttt{decreasing}\)
- \(\texttt{fluctuating}\)
inputFormat
The first line contains an integer (n) denoting the number of days. The second line contains (n) space-separated integers representing the memory usage values for each day.
outputFormat
Print a single line containing one of the strings: "increasing", "decreasing", or "fluctuating", which represents the trend of memory usage.## sample
7
100 150 200 250 300 400 500
increasing