summaryrefslogtreecommitdiff
path: root/content/other
diff options
context:
space:
mode:
Diffstat (limited to 'content/other')
-rw-r--r--content/other/other.tex18
-rw-r--r--content/other/recover.cpp13
2 files changed, 6 insertions, 25 deletions
diff --git a/content/other/other.tex b/content/other/other.tex
index 368d0b3..191a6da 100644
--- a/content/other/other.tex
+++ b/content/other/other.tex
@@ -72,6 +72,12 @@
\sourcecode{other/sos.cpp}
\end{algorithm}
+\begin{algorithm}{Fast Subset Sum}
+ \method{fastSubsetSum}{findet maximale subset $\mathit{sum}\leq t$}{n \cdot A}
+ Die Laufzeit hängt vom maximalen Wert $A$ in der Menge ab.
+ \sourcecode{other/fastSubsetSum.cpp}
+\end{algorithm}
+
\begin{algorithm}{Parallel Binary Search}
\sourcecode{other/pbs.cpp}
\end{algorithm}
@@ -95,18 +101,6 @@
\textbf{Beachte bei der Ausgabe, dass die Personen im ersten Fall von $\boldsymbol{1, \ldots, n}$ nummeriert sind, im zweiten Fall von $\boldsymbol{0, \ldots, n-1}$!}
\end{algorithm}
-\vfill\null\columnbreak
-
-\subsection{Recover $\boldsymbol{x}$ and $\boldsymbol{y}$ from $\boldsymbol{y}$ from $\boldsymbol{x\*y^{-1}}$ }
-\method{recover}{findet $x$ und $y$ für $x=x\*y^{-1}\bmod m$}{\log(m)}
-\textbf{WICHTIG:} $x$ und $y$ müssen kleiner als $\sqrt{\nicefrac{m}{2}}$ sein!
-\sourcecode{other/recover.cpp}
-
-\subsection{Fast Subset Sum}
-\method{fastSubsetSum}{findet maximale subset sum $\leq t$}{n \cdot A}
-Die Laufzeit hängt vom maximalen Wert $A$ in der Menge ab.
-\sourcecode{other/fastSubsetSum.cpp}
-
\begin{algorithm}[optional]{Zeileneingabe}
\sourcecode{other/split.cpp}
\end{algorithm}
diff --git a/content/other/recover.cpp b/content/other/recover.cpp
deleted file mode 100644
index 1a593f0..0000000
--- a/content/other/recover.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-ll sq(ll x) {return x*x;}
-
-array<ll, 2> recover(ll c, ll m) {
- array<ll, 2> u = {m, 0}, v = {c, 1};
- while (m <= 2 * sq(v[0])) {
- ll q = u[0] / v[0];
- u[0] -= q * v[0];
- u[1] -= q * v[1];
- swap(u, v);
- }
- if (v[1] <= 0 || 2 * sq(v[1]) >= m) return {-1, -1};
- return v;
-}