#include<bits/stdc++.h>usingnamespacestd; typedeflonglongll;constintinf=1e18;constintmaxn=3e5+7;constintmod=1e9+7;#definemem0(a) memset(a,0,sizeof(a))#definememinf(a) memset(a,0x3f,sizeof(a))#definels rt<<1#definers rt<<1|1#definemid (l+r)>>1ll a[maxn],dp[maxn][2...
D. Yet Another Inversions Problem You are given a permutation $p_0, p_1, \ldots, p_{n-1}$ of odd integers from $1$ to $2n-1$ and a permutation $q_0, q