P10216 [Template] Pfaffian
Background
A permutation $\pi$ of length $2n$ is called a perfect matching if and only if it satisfies:
- $\forall 1\le i\le n,\ \pi_{2i-1}
Description
Given an even integer $n$ and a skew-symmetric matrix $\mathbf{A}=(a_{i,j})_{1\le i
Input Format
The first line contains a positive integer $n$, and it is guaranteed that $n$ is even.
The next $n-1$ lines describe the matrix. On the $i$-th line, there are $n-i$ non-negative integers, where the $j$-th integer represents $a_{i,i+j}$.
Output Format
Output one non-negative integer, the answer.
Explanation/Hint
For $30\%$ of the testdata, $n\le 10$.
For $100\%$ of the testdata, $2\le n\le 500$, $0\le a_{i,j}