cf/mirror

The Ultimate LIS Problem

CF
1685E3500· legendary gm2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
2 6
1 2 3 4 5
1 5
1 5
4 5
5 4
1 4
2 5
Output
-1
-1
2
-1
4
0
1685E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)