Skip to content

Commit

Permalink
Update chapter.tex
Browse files Browse the repository at this point in the history
  • Loading branch information
hockyy authored Jan 3, 2024
1 parent ab0463f commit 3eaaaa4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion content/various/chapter.tex
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ \section{Optimization tricks}
\item \verb@for (int x = m; x; ) { --x &= m; ... }@ loops over all subset masks of \texttt{m} (except \texttt{m} itself).
\item \verb@c = x&-x, r = x+c; (((r^x) >> 2)/c) | r@ is the next number after \texttt{x} with the same number of bits set.
\item \verb@rep(b,0,K) rep(i,0,(1 << K))@ \\ \verb@ if (i & 1 << b) D[i] += D[i^(1 << b)];@ computes all sums of subsets.
\item \verb@for (LL x = (1LL << n) - 1, ori = (1LL << m); x < ori;) { /*Use x here*/ LL c = x & -x, r = x + c; x = (((r ^ x) >> 2) / c) | r;}
\end{itemize}
\subsection{Pragmas}
\begin{itemize}
Expand Down Expand Up @@ -135,4 +136,4 @@ \section{Minimum-Cut Problems}
% UpdateBIT2(BITree2, r+1, -val*r) \\

% Range Sum \\
% getSum(BITTree1, k) *k) - getSum(BITTree2, k) \\
% getSum(BITTree1, k) *k) - getSum(BITTree2, k) \\

0 comments on commit 3eaaaa4

Please sign in to comment.