시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 512 MB | 1178 | 616 | 533 | 56.105% |
In each of $K$ practice sessions ($1 \leq K \leq 10$), Bessie ranks the $N$ cows according to their performance ($1 \leq N \leq 20$). Afterward, she is curious about the consistency in these rankings. A pair of two distinct cows is consistent if one cow did better than the other one in every practice session.
Help Bessie compute the total number of consistent pairs.
3 4 4 1 2 3 4 1 3 2 4 2 1 3
4
The consistent pairs of cows are $(1,4)$, $(2,4)$, $(3,4)$, and $(1,3)$.