cf/mirror

Long Permutation

CF
1443E2400· grandmaster4s256 MB⌨ stdin/stdout

Examples

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