Splittable Permutations
1976E2500· grandmaster2s512 MB⌨ stdin/stdout
Examples
Sample 1of 3
Input
6 36 4 45 5 2
Output
30
Sample 2of 3
Input
10 1109
Output
1814400
Sample 3of 3
Input
4 124
Output
8
58%
1976E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…