cf/mirror

Inversion of a Subsequence

CF
2247C2s256 MB⌨ stdin/stdout

Examples

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