From 381b4c8bd4dd0c45ddf0b0e03ec93f2d671ef51e Mon Sep 17 00:00:00 2001 From: ITCharge Date: Fri, 28 Jun 2024 09:26:11 +0800 Subject: [PATCH] Update 01.State-DP.md --- Contents/10.Dynamic-Programming/07.State-DP/01.State-DP.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contents/10.Dynamic-Programming/07.State-DP/01.State-DP.md b/Contents/10.Dynamic-Programming/07.State-DP/01.State-DP.md index 4282362d..74ccfd64 100644 --- a/Contents/10.Dynamic-Programming/07.State-DP/01.State-DP.md +++ b/Contents/10.Dynamic-Programming/07.State-DP/01.State-DP.md @@ -75,7 +75,7 @@ - 在集合 $A$ 中删除第 $i$ 位元素(将二进制数第 $i$ 位赋值为 $0$):`A = A & ~(1 << i)` - 判断集合 $A$ 是否选取了第 $i$ 位元素(判断二进制数第 $i$ 位是否为 $1$) :`if A & (1 << i):` 或者 `if (A >> i) & 1:` - 将集合 $A$ 设置为空集:`A = 0` -- 将集合 $A$ 设置为全集:`A = 1 << n` +- 将集合 $A$ 设置为全集:`A = 1 << n - 1` - 求集合 $A$ 的补集:`A = A ^ ((1 << n) - 1)` - 求集合 $A$ 与集合 $B$ 的并集:`A | B` - 求集合 $A$ 与集合 $B$ 的交集:`A & B`