cf/mirror

Coprime Permutation

CF
698F3000· legendary gm2s256 MB⌨ stdin/stdout

Examples

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