Permutation Partitions
1326C1300· pupil1s256 MB⌨ stdin/stdout
Examples
Sample 1of 3
Input
3 22 1 3
Output
5 2
Sample 2of 3
Input
5 52 1 5 3 4
Output
15 1
Sample 3of 3
Input
7 32 7 3 1 5 4 6
Output
18 6
58%
1326C.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)