6880专题

杭电多校第10场 6880 Permutation Counting(DP)

Problem Description For a given permutation a1,a2,⋯,an of length n, we defined the neighbor sequence b of a, the length of which is n−1, as following: bi={01ai<ai+1ai>ai+1 . For example, the neighbo