You are given an integer sequence $(A_ 0, A_ 1, \ldots, A_ {N-1})$
with the length $N$. Process the following $Q$ queries in order.
l_i r_i: Print the number of inversions in $(A_ {l_ i}, A_ {l_ i+1}, \ldots, A_ {r_ i-1})$An inversion in a sequence $(B_ 0, B_ 1, \ldots, B_ {M-1})$
is a pair of indices $(i, j)$ such that
$0 \leq i < j \lt M$ and $B_ i \gt B_ j$.
$N$ $Q$
$A_ 0$ $A_ 1$ $\ldots$ $A_ {N-1}$
$l_ 0$ $r_ 0$
$l_ 1$ $r_ 1$
$\vdots$
$l_ {Q-1}$ $r_ {Q-1}$
4 2 4 1 4 0 1 3 0 4
0 4
| No. | Testdata Range | Score |
|---|