【杂题乱写】2023-11 #2

发布时间 2023-11-24 17:21:52作者: yspm

ARC147C

Find the maximum L and the minimum R to be mL and mR respectively.

If mL<=mR holds, we can set every \(x_i\) to be mL and the contribution will be 0.Otherwise we'd greedily set \(R_{\arg\min R}=mR\) and \(L_{\arg\max L}=mL\). All the other \(x_i\)s would choose a position between \([mR,mL]\) and there will be a contribution of \((mL-mR)\times num\) where \(num\) represents the number of \(i\)s who don't have a fixed position.

Sort the array L & the array R will help.

ARC157C

Square number equals to the ways of choosing two stuffs during the process.So calculate with DP: let \(f_{i,j,0/1/2,0/1}\) represents the number of ways which end at (i,j) with 0/1/2 YY(s) chosen and the latest character is Y or not.

Transitions are trivial.

ARC147E

ARC156B

其实你强制 mex 从小到大加入就行了是不是,这时候就变成了插板。如果有某个位置没数了,就先强制一个集合的 mex 是它再插板咯。

ARC157E

由于没有 YY 的出现,所以 Y 的出现位置本质上是一个独立集。