标签:inline mat 严格 block for strong ble 调整 test
令\(p=x+y\)
结论1:若在\([0,p)\)中选择的合法集合为\(\{a_1,a_2,\cdots,a_k\}\),那么在\([p,2p)\)中设置\(\{a_1+p,a_2+p,\cdots,a_k+p\}\)后仍然合法
证明:
\([p,2p)\)中显然合法
若\(\exists i,j\),\(s.t.~a_i+p-a_j=x\)
则\(a_i+p-a_j=x\Longrightarrow a_i-a_j=x-p=x-x-y=-y\),那么\(|a_i-a_j|=y\),与\(\{a_1,a_2,\cdots,a_k\}\)合法矛盾
结论2:存在最优解,其集合分布是严格周期为\(p\)的设置
证明:
令\(r\equiv n(mod~p)\)
我们将\([0,n)\)分为:\([0,r),[r,p),[p,p+r),[p+r,2p),\cdots,[\left\lfloor\frac{n-1}{p}\right\rfloor p,n)\)
任意两个相邻区间长度之和为\(p\)
显然可通过调整最优解使得其集合分布为严格周期为\(p\)的设置
那么可通过简单的状压计算
\(O((x+y)2^{max(x,y)})\)
标签:inline mat 严格 block for strong ble 调整 test
原文地址:https://www.cnblogs.com/Grice/p/14158005.html