File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 4444\sum_{S \subseteq \textit{or}} (-1)^{|\complement_{\textit{or}}S|}2^{f[S]}
4545$$
4646
47- 其中 $\complement_ {\textit{or}}S$ 表示 $S$ 关于 $\textit{or}$ 的补集,$|\complement_ {\textit{or}}S|$ 即这个补集的大小(元素个数),说人话就是:
47+ 其中 $\complement_ {\textit{or}}S$ 表示 $S$ 关于 $\textit{or}$ 的补集,$|\complement_ {\textit{or}}S|$ 即这个补集的大小(元素个数)。
48+
49+ 通俗地说:
4850
4951- 如果 $S$ 与 $\textit{or}$ 相差偶数个数,那么加上 $2^{f[ S] }$。
5052- 如果 $S$ 与 $\textit{or}$ 相差奇数个数,那么减去 $2^{f[ S] }$。
@@ -102,9 +104,9 @@ class Solution:
102104 while True :
103105 p2 = pow2[f[sub]]
104106 ans -= - p2 if (or_all ^ sub).bit_count() % 2 else p2
105- sub = (sub - 1 ) & or_all
106- if sub == or_all:
107+ if sub == 0 :
107108 break
109+ sub = (sub - 1 ) & or_all
108110 return ans % MOD
109111```
110112
You can’t perform that action at this time.
0 commit comments