summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--other/other.tex3
-rw-r--r--other/sos.cpp2
-rw-r--r--tcr.pdfbin649345 -> 649611 bytes
3 files changed, 3 insertions, 2 deletions
diff --git a/other/other.tex b/other/other.tex
index 74e3ba8..cc89503 100644
--- a/other/other.tex
+++ b/other/other.tex
@@ -63,7 +63,8 @@
\paragraph{Quadrangle inequality} Die Bedingung $\forall a\leq b\leq c\leq d:
C[a][d] + C[b][c] \geq C[a][c] + C[b][d]$ ist hinreichend für beide Optimierungen.
- \paragraph{Sum over Subsets DP} $\text{res}[\text{mask}]=\sum_{i\subseteq\text{mask}}\text{in}[i]$
+ \paragraph{Sum over Subsets DP} $\text{res}[\text{mask}]=\sum_{i\subseteq\text{mask}}\text{in}[i]$.
+ Für Summe über Supersets \code{res} einmal vorher und einmal nachher reversen.
\sourcecode{other/sos.cpp}
\end{algorithm}
diff --git a/other/sos.cpp b/other/sos.cpp
index 0fe5dc0..01bc44c 100644
--- a/other/sos.cpp
+++ b/other/sos.cpp
@@ -2,5 +2,5 @@ vector<ll> res(in);
for (int i = 1; i < sz(res); i *= 2) {
for (int mask = 0; mask < sz(res); mask++){
if (mask & i) {
- F[mask] += F[mask ^ i];
+ res[mask] += res[mask ^ i];
}}}
diff --git a/tcr.pdf b/tcr.pdf
index 5ec82f0..2b8297e 100644
--- a/tcr.pdf
+++ b/tcr.pdf
Binary files differ