cf/mirror

Almost Increasing Subsequence

CF
1817A1500· specialist2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
9 8
1 2 4 3 3 5 6 2 1
1 3
1 4
2 5
6 6
3 7
7 8
1 8
8 8
Output
3
4
3
1
4
2
7
1
1817A.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)