Skip to content

Commit c709cc8

Browse files
Create description.md
1 parent d941cc3 commit c709cc8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Almost strictly increasing sequence
2+
## Statement
3+
It is necessary to delete the minimum number of elements from a given numerical sequence A of length n, so that the remaining elements form a strictly increasing subsequence almost everywhere, that is, containing at most one discontinuity-pairs (ai, ai + 1) of consecutive elements, the second of which is not more than the first. The constructed algorithm must have the complexity O (n log n).
4+
## Time and memory limit
5+
Time limit: 1 s<br>
6+
Memory limit: no
7+
## Input file format
8+
The first line contains the number n (1 ≤ n ≤ 100 000). The next line contains n elements of the sequence A, which are separated by a space (the elements of the sequence are positive integers not exceeding 1 000 000 000).
9+
## Output file format
10+
The length of a subsequence of elements that is strictly increasing almost everywhere.
11+
## Example
12+
| input | output |
13+
| ------------- | ------------- |
14+
| 9<br>1 2 12 7 3 8 14 13 9| 6 |

0 commit comments

Comments
 (0)