New Year Permutation

2020 VietMX 0

User ainta has a permutation p 1, p 2, …, p n. As the New Year is coming, he wants to make his permutation as pretty as possible. Permutation a 1, a 2, …, a n is prettier than permutation b 1, b 2, …, b n, if and […]

New Year and Permutation

2020 VietMX 0

Recall that the permutation is an array consisting of $n$ distinct integers from $1$ to $n$ in arbitrary order. For example, $[2,3,1,5,4]$ is a permutation, […]