Longest Max Min Subsequence
2001D1900· candidate master2s256 MB⌨ stdin/stdout
Examples
Sample 1of 2
Input
443 2 1 341 1 1 193 2 1 3 2 1 3 2 111
Output
33 2 11133 1 211
Sample 2of 2
Input
1021 2105 2 1 7 9 7 2 5 5 221 2102 2 8 7 7 9 8 1 9 699 1 7 5 8 5 6 4 133 3 361 6 4 4 6 563 4 4 5 3 3104 1 4 5 4 5 10 1 5 171 2 1 3 2 4 6
Output
21 255 1 9 7 221 262 7 9 8 1 679 1 7 5 8 6 41341 4 6 534 5 345 4 10 152 1 3 4 6
58%
2001D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)