cf/mirror

Interesting Problem (Hard Version)

CF
1987F22600· international gm2s256 MB⌨ stdin/stdout
#dp

Examples

Sample 1of 1multi-test • hover to link
Input
6
5
1 5 3 2 4
8
2 1 3 4 5 6 7 8
3
1 2 3
4
1 2 4 4
5
4 4 1 3 5
1
1
Output
2
3
1
2
0
0
1987F2.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)