用户工具

站点工具


2022-2023:teams:eager_to_embrace_the_seniors_thigh:1h

这是本文档旧的修订版!


目录

Fly

题意

给定一个长度为 $n$ 的数列 $a_i$ 和 $k$ 个限制形如 $(b_i,c_i)$ 和一个数 $m$ ,求有多少个数列 $x_i$ 满足 $\sum{a_ix_i}\le m$ 且 $x_{b_i}\& 2^{c_i}=0$ 。

$n\le 4*10^4, m\le 10^{18}, k\le 5*10^3, \sum{a_i}\le 4*10^4, b_i\le n, c_i<60$

题解

我们发现限制是对于每个 $x_i$ 的二进制位进行的,所以考虑直接将 $a_ix_i$ 分成 $\sum{a_i2^ky_{i,k}}$ ,其中 $y_{i,k}$ 表示 $a_i2^k$ 是否被选择了。

2022-2023/teams/eager_to_embrace_the_seniors_thigh/1h.1660203605.txt.gz · 最后更改: 2022/08/11 15:40 由 11231123